From fd406fea4dec7eaaab68d8cec72b58b8caf51c7b Mon Sep 17 00:00:00 2001 From: liufei Date: Fri, 20 Aug 2021 15:44:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8E=86=E5=8F=B2=E5=BE=85=E5=8A=9Ebug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/UserControls/ToDo/TodoControl.xaml.cs | 17 +++++++++++++++-- Control/Windows/ToDoWindow.xaml.cs | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Control/UserControls/ToDo/TodoControl.xaml.cs b/Control/UserControls/ToDo/TodoControl.xaml.cs index 25442d3..971ab83 100644 --- a/Control/UserControls/ToDo/TodoControl.xaml.cs +++ b/Control/UserControls/ToDo/TodoControl.xaml.cs @@ -19,12 +19,18 @@ using System.Windows.Shapes; namespace GeekDesk.Control.UserControls.Backlog { + + public enum ToDoType + { + HISTORY = 1, + NEW = 2 + } /// /// BacklogControl.xaml 的交互逻辑 /// public partial class TodoControl : UserControl { - private AppData appData = MainWindow.appData; + public ToDoType type; public TodoControl() { InitializeComponent(); @@ -37,7 +43,14 @@ namespace GeekDesk.Control.UserControls.Backlog { if (isConfirmed) { - appData.ToDoList.Remove(info); + if (type == ToDoType.NEW) + { + MainWindow.appData.ToDoList.Remove(info); + } + else + { + MainWindow.appData.HiToDoList.Remove(info); + } CommonCode.SaveAppData(MainWindow.appData); } return true; diff --git a/Control/Windows/ToDoWindow.xaml.cs b/Control/Windows/ToDoWindow.xaml.cs index c68072d..4f1ded7 100644 --- a/Control/Windows/ToDoWindow.xaml.cs +++ b/Control/Windows/ToDoWindow.xaml.cs @@ -64,9 +64,11 @@ namespace GeekDesk.Control.Windows { case "History": backlog.BacklogList.ItemsSource = appData.HiToDoList; + backlog.type = ToDoType.HISTORY; break; default: backlog.BacklogList.ItemsSource = appData.ToDoList; + backlog.type = ToDoType.NEW; break; } }