This repository was archived by the owner on May 1, 2024. It is now read-only.
Decorate NumericValidationBehavior value #1062
Unanswered
stephenhauck
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi @stephenhauck You will have to extend NumericValidationBehavior. public class MoneyValidationBehavior : NumericValidationBehavior {
protected override object? Decorate(object? value)
=> base.Decorate(value)?.ToString()?.Replace("$", string.Empty);
} And use MoneyValidationBehavior ) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I am using a NumericValidationBehavior

And a converter to format the display ...
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return Decimal.Parse(value.ToString()).ToString("C"); }
How do I format the output for the user but validate the input ?
Beta Was this translation helpful? Give feedback.
All reactions