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.
27 lines
757 B
27 lines
757 B
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace BBWY.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();
|
|
}
|
|
}
|
|
}
|
|
|