修复无法删除历史待办bug

This commit is contained in:
liufei
2021-08-20 15:44:07 +08:00
parent d46eae4c6e
commit fd406fea4d
2 changed files with 17 additions and 2 deletions

View File

@@ -19,12 +19,18 @@ using System.Windows.Shapes;
namespace GeekDesk.Control.UserControls.Backlog
{
public enum ToDoType
{
HISTORY = 1,
NEW = 2
}
/// <summary>
/// BacklogControl.xaml 的交互逻辑
/// </summary>
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;

View File

@@ -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;
}
}