private void CheckBox_Click(object sender, RoutedEventArgs e) { var data = (sender as FrameworkElement).DataContext; var item = ItemListView.ContainerFromItem(data) as ListViewItem; DataService.Complete((item.Content as Models.TodoItem).id, (sender as CheckBox).IsChecked.Value); }
private void SettingButton_Click(object sender, RoutedEventArgs e) { var data = (sender as FrameworkElement).DataContext; var item = ItemListView.ContainerFromItem(data) as ListViewItem; ViewModel.selectedItem = item.Content as Models.TodoItem; }
/// <summary> /// 点击设置按钮触发的函数 /// </summary> private void Setting_Clicked(object sender, RoutedEventArgs e) { var data = (sender as FrameworkElement).DataContext; var item = ItemListView.ContainerFromItem(data) as ListViewItem; Item = item.Content as Models.ListItem; }
private void DeleteButton_Click(object sender, RoutedEventArgs e) { var data = (sender as FrameworkElement).DataContext; var item = ItemListView.ContainerFromItem(data) as ListViewItem; ViewModel.selectedItem = item.Content as Models.TodoItem; DataService.Delete(ViewModel.selectedItem.id); PageView.Content = null; ViewModel.selectedItem = null; VisualStateChange(); }