コード例 #1
0
        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);
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        /// <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;
        }
コード例 #4
0
        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();
        }