Код: Выделить всё
Код: Выделить всё
namespace MyComponent;
public partial class NewContent1 : ContentView
{
public NewContent1()
{
InitializeComponent();
BindingContext = this;
}
public static readonly BindableProperty MyPropertyProperty = BindableProperty.Create(
nameof(MyProperty),
typeof(string),
typeof(NewContent1),
string.Empty);
public string MyProperty
{
get => (string)GetValue(MyPropertyProperty);
set => SetValue(MyPropertyProperty, value);
}
}
Код: Выделить всё
Код: Выделить всё
public partial class MainPage : ContentPage
{
private string _myVariable;
public string MyVariable
{
get => _myVariable;
set
{
_myVariable = value;
OnPropertyChanged(nameof(MyVariable));
}
}
public MainPage()
{
InitializeComponent();
BindingContext = this;
}
}
code> на главной странице тоже обновляется, но это не работает.
Что я пропустил?
Подробнее здесь: https://stackoverflow.com/questions/790 ... lling-page