You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
758 B
28 lines
758 B
2 years ago
|
using System;
|
||
|
using System.Globalization;
|
||
|
using System.Windows.Data;
|
||
|
|
||
|
namespace BBWYB.Client.Converters
|
||
|
{
|
||
|
public class WidthConveter : IValueConverter
|
||
|
{
|
||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||
|
{
|
||
|
if (value is double)
|
||
|
{
|
||
|
double.TryParse(parameter?.ToString(), out double p);
|
||
|
var width = (double)value;
|
||
|
if (width == 0)
|
||
|
return 0;
|
||
|
return width - p;
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||
|
{
|
||
|
throw new NotImplementedException();
|
||
|
}
|
||
|
}
|
||
|
}
|