//吴成文:分享指定文件 //分享指定文件 private void MenuFlyShare_Click(object sender, RoutedEventArgs e) { var datacontext = (sender as FrameworkElement).DataContext; var item = MainLeftItemList.ContainerFromItem(datacontext) as ListViewItem; timeReaper.SelectedItem = (ListItem)(item.Content); DataTransferManager.ShowShareUI(); }
//删除指定文件 private void MenuFlyDelete_Click(object sender, RoutedEventArgs e) { var datacontext = (sender as FrameworkElement).DataContext; var item = MainLeftItemList.ContainerFromItem(datacontext) as ListViewItem; timeReaper.SelectedItem = (ListItem)(item.Content); timeReaper.RemoveTodoItem(timeReaper.SelectedItem); timeReaper.SelectedItem = null; UpdateTile(); }
//前往编辑页面(编辑与创造的区别在于timeReaper.SelectedItem是否为空) private void MenuFlyEdit_Click(object sender, RoutedEventArgs e) { var datacontext = (sender as FrameworkElement).DataContext; var item = MainLeftItemList.ContainerFromItem(datacontext) as ListViewItem; timeReaper.SelectedItem = (ListItem)(item.Content); if (timer != null) { timeReaper.cacheBeginTime = beginTime; timeReaper.cacheTimerState = timerState; timeReaper.cacheNeedPress = needPress; timeReaper.cacheWork = work; } Frame.Navigate(typeof(CreatePage)); }