We think we managed to understand completely your requirement. Our previous point was that validation should be usually implemented in the ViewModels, however, of course in WPF everything is possible in code behind too.
RadMaskedNumericInput's Value property is of type double? which means it accepts null values. To avoid them you can set:
This way the clear button won't produce null Value. On the other hand, you can bind to double property from the ViewModel but not double? property.
Instead of your custom Validation, you can use the MaskedInputExtensions.MInimum and Maximum properties but have in mind the following - initially the ViewModel's value won't be synced - for example the control will show 10 if the MInimum is set to 10, but the VM's Value won't be updated. However, in code, if the user is about to submit the changes to the DB, you can update all ViewModels:
sender, RoutedEventArgs e)
var expr =
You can find this implemented in the attached project. Just press the button and the ViewModel's value will be updated.
Please let us know if this helps you proceed further.
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>