Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The so-obvious-you-d-think-it'd-be-in-the-library value converter used in binding a control to something-a-specific-bit-less-than-the-size-of-its-parent.
public class SubtractConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
return (double)value - System.Convert.ToDouble(parameter);
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return (double)value + System.Convert.ToDouble(parameter);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment