2021-09-11 15:32:30 +08:00
|
|
|
|
using GeekDesk.Constant;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
|
|
|
|
|
|
|
namespace GeekDesk.Converts
|
|
|
|
|
|
{
|
2022-05-20 15:39:52 +08:00
|
|
|
|
public class TodoTaskExecConvert : IValueConverter
|
2021-09-11 15:32:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
return (TodoTaskExecType)value == (TodoTaskExecType)int.Parse(parameter.ToString());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool isChecked = (bool)value;
|
|
|
|
|
|
if (!isChecked)
|
|
|
|
|
|
{
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
return (TodoTaskExecType)int.Parse(parameter.ToString());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|