优化部分代码,尝试修复热键回调多次bug

This commit is contained in:
Demo_Liu
2021-07-18 20:10:19 +08:00
parent 3a72bc6e65
commit cdbdae09c7
18 changed files with 359 additions and 112 deletions

View File

@@ -37,18 +37,79 @@ namespace GeekDesk.ViewModel
private int pannelCornerRadius = 4; //面板圆角 默认4
[field: NonSerialized]
private ObservableCollection<IconInfo> selectedMenuIcons;
private string hotkeyStr = "Ctrl + Q"; //默认启动面板快捷键
private HotkeyModifiers hotkeyModifiers = HotkeyModifiers.MOD_CONTROL; //默认启动面板快捷键
private Key hotkey = Key.Q; //默认启动面板快捷键
private string toDoHotkeyStr; //待办任务快捷键
private HotkeyModifiers toDoHotkeyModifiers; //待办任务快捷键
private Key toDoHotkey; //待办任务快捷键
private string customIconUrl; //自定义图标url
private string customIconJsonUrl; //自定义图标json信息url
private bool blurEffect = false; //毛玻璃效果 默认否
private double blurValue;
private UpdateType updateType = UpdateType.Gitee; //更新源 默认gitee源
#region GetSet
public Key ToDoHotkey
{
get
{
return toDoHotkey;
}
set
{
toDoHotkey = value;
OnPropertyChanged("ToDoHotkey");
}
}
public HotkeyModifiers ToDoHotkeyModifiers
{
get
{
return toDoHotkeyModifiers;
}
set
{
toDoHotkeyModifiers = value;
OnPropertyChanged("ToDoHotkeyModifiers");
}
}
public string ToDoHotkeyStr
{
get
{
return toDoHotkeyStr;
}
set
{
toDoHotkeyStr = value;
OnPropertyChanged("ToDoHotkeyStr");
}
}
public UpdateType UpdateType
{
get
{
return updateType;
}
set
{
updateType = value;
OnPropertyChanged("UpdateType");
}
}
public double BlurValue
{
get

View File

@@ -14,42 +14,42 @@ namespace GeekDesk.ViewModel
{
private ObservableCollection<MenuInfo> menuList; //菜单信息及菜单对应icon信息
private AppConfig appConfig = new AppConfig(); //程序设置信息
private ObservableCollection<BacklogInfo> hiBacklogList; //历史待办
private ObservableCollection<BacklogInfo> exeBacklogList; //未处理待办 为了提高任务效率 分开处理
private ObservableCollection<ToDoInfo> hiToDoList; //历史待办
private ObservableCollection<ToDoInfo> toDoList; //未处理待办 为了提高任务效率 分开处理
public ObservableCollection<BacklogInfo> HiBacklogList
public ObservableCollection<ToDoInfo> HiToDoList
{
get
{
if (hiBacklogList == null)
if (hiToDoList == null)
{
hiBacklogList = new ObservableCollection<BacklogInfo>();
hiToDoList = new ObservableCollection<ToDoInfo>();
}
return hiBacklogList;
return hiToDoList;
}
set
{
hiBacklogList = value;
OnPropertyChanged("HiBacklogList");
hiToDoList = value;
OnPropertyChanged("HiToDoList");
}
}
public ObservableCollection<BacklogInfo> ExeBacklogList
public ObservableCollection<ToDoInfo> ToDoList
{
get
{
if (exeBacklogList == null)
if (toDoList == null)
{
exeBacklogList = new ObservableCollection<BacklogInfo>();
toDoList = new ObservableCollection<ToDoInfo>();
}
return exeBacklogList;
return toDoList;
}
set
{
exeBacklogList = value;
OnPropertyChanged("ExeBacklogList");
toDoList = value;
OnPropertyChanged("ToDoList");
}
}

View File

@@ -10,7 +10,7 @@ namespace GeekDesk.ViewModel
{
[Serializable]
public class BacklogInfo : INotifyPropertyChanged
public class ToDoInfo : INotifyPropertyChanged
{
//private string id; //任务唯一id
private string title; //待办事项