fix #41 优化待办任务

This commit is contained in:
liufei
2022-05-23 17:56:39 +08:00
parent 1a1350ee53
commit a7a2ee9f08
8 changed files with 248 additions and 12 deletions

View File

@@ -0,0 +1,43 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace GeekDesk.Converts
{
public class Count2VisibleConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null) return Visibility.Collapsed;
int count = (int)value;
if (parameter == null || "Y".Equals(parameter.ToString()))
{
if (count > 0)
{
return Visibility.Visible;
}
else
{
return Visibility.Collapsed;
}
} else
{
if (count <= 0)
{
return Visibility.Visible;
}
else
{
return Visibility.Collapsed;
}
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace GeekDesk.Converts
{
public class CountGreZero2BoolConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null) return false;
int count = (int)value;
if (count > 0)
{
return true;
} else
{
return false;
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}