I'm creating ToDo app in Xamarin forms. I have a problem with Checkbox in Listview where are displayed ToDos. I can't find out how to get ToDo after checkbox is checked...
Checkbox in XAML:
<CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}" Grid.Row="0" Grid.Column="1" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" />
Method for getting information if checkbox is checked in ViewModel:
private bool isChecked;
public bool IsChecked
{
get { return isChecked; }
set
{
if (isChecked != value)
{
isChecked = value;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("IsSelected"));
App.Current.MainPage.DisplayAlert("Title", " item have been selected", "Cancel");
}
}
}
}
I'd be grateful for every suggestion how to implement into MVVM.