Update ColorPickerVerticalSlider.cs
This commit is contained in:
Родитель
75897278a3
Коммит
cc87e2df9c
|
@ -136,12 +136,24 @@ public class ColorPickerVerticalSlider : TemplatedControl
|
|||
|
||||
private T? Convert<T>(IValueConverter converter, T? value, T? range)
|
||||
{
|
||||
return (T?)converter.Convert(value, typeof(T), range, CultureInfo.CurrentCulture);
|
||||
var converted = converter.Convert(value, typeof(T), range, CultureInfo.CurrentCulture);
|
||||
if (converted == AvaloniaProperty.UnsetValue)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
var result = (T?)converted;
|
||||
return result;
|
||||
}
|
||||
|
||||
private T? ConvertBack<T>(IValueConverter converter, T? value, T? range)
|
||||
{
|
||||
return (T?)converter.ConvertBack(value, typeof(T), range, CultureInfo.CurrentCulture);
|
||||
var converted = converter.ConvertBack(value, typeof(T), range, CultureInfo.CurrentCulture);
|
||||
if (converted == AvaloniaProperty.UnsetValue)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
var result = (T?)converted;
|
||||
return result;
|
||||
}
|
||||
|
||||
private void UpdateValuesFromThumbs()
|
||||
|
|
Загрузка…
Ссылка в новой задаче