Код: Выделить всё
public partial class EntryChoices : ContentView
{
public static readonly BindableProperty ValuesProperty =
BindableProperty.Create(nameof(Values),
typeof(List), typeof(EntryChoices),
null, BindingMode.TwoWay);
public List? Values
{
get => (List)GetValue(ValuesProperty);
set => SetValue(ValuesProperty, value);
}
}
Код: Выделить всё
Код: Выделить всё
OnPropertyChanged(nameof(Values));
Код: Выделить всё
public void AddItem(string item)
{
if (Values == null)
Values = new List();
Values.Add(item);
OnPropertyChanged(nameof(Values));
OnPropertyChanged(nameof(ValueString));
}
Подробнее здесь: https://stackoverflow.com/questions/790 ... t-for-maui