This commit is contained in:
NaBian committed 2019-12-19 01:05:08 +08:00
1 parent 0b79d187ac
commit 99874a418f
16 files changed
+53 -17

No files matched your search

@@ -30,11 +30,11 @@ namespace HandyControl.Tools.Converter
}
catch
{
return new SolidColorBrush(default(Color));
return new SolidColorBrush(default);
}
return new SolidColorBrush(default(Color));
return new SolidColorBrush(default);
}
return new SolidColorBrush(default(Color));
return new SolidColorBrush(default);
}
}
}
@@ -0,0 +1,31 @@
using System;
using System.Globalization;
using System.Windows.Data;
using HandyControl.Tools.Extension;
namespace HandyControl.Tools.Converter
{
public class DoubleMinConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is double doubleValue)
{
if (parameter is string str)
{
var minValue = str.Value<double>();
return doubleValue < minValue ? minValue : doubleValue;
}
return doubleValue < .0 ? .0 : doubleValue;
}
return .0;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}