优化部分代码,尝试修复热键回调多次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

@@ -0,0 +1,29 @@
using GeekDesk.Constant;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace GeekDesk.Converts
{
class UpdateTypeConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (UpdateType)value == (UpdateType)int.Parse(parameter.ToString());
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
bool isChecked = (bool)value;
if (!isChecked)
{
return null;
}
return (UpdateType)int.Parse(parameter.ToString());
}
}
}