步步为盈
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
757 B

3 years ago
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();
}
}
}