-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add Converter to reduce a numeric value in a XamlBinding #264
Copy link
Copy link
Closed
Description
public sealed class NumericCalculationConverter : IValueConverter
{
public double Adjustment { get; set; } = 0;
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is double numVal)
{
return numVal + Adjustment;
}
return value;
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is double numVal)
{
return numVal - Adjustment;
}
return value;
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request