Is there an easy way to have XamMaskedInput validate and set the Validation.HasErrors and related attached properties like other WPF controls?
I realize that the mask is supposed to prevent bad data in the first place. But if the user initiates a save operation and the value is still focused and is still invalid (has InvalidValueErrorInfo) then ideally we would be able to programmatically detect the invalid data with program logic that is generic (ie. Validation.HasErrors). Its kind of a pain to create special-purpose code for ValueInput-derived controls.
Hello dbeavon,
Thank you for your post!
I have been looking into your question. You can set the ValueConstraint properties for the XamMaskedInput. Using them you can set a range of numbers, that you want the user to be able to enter in the input. More about the ValueConstraints you can find on the following link from our documentation: http://help.infragistics.com/Help/Doc/WPF/2014.2/CLR4.0/html/InfragisticsWPF4.Controls.Editors.XamMaskedInput.v14.2~Infragistics.Controls.Editors.ValueInput~InvalidValueBehavior.html.
Would you please provide me with more detailed information about your scenario and the functionality you want to achieve, in order for me to be able to further investigate this issue you?
Looking forward to hearing from you.
In my case the mask of the XmlMaskedInput is simply as follows : (Mask="hh:mm").
I noticed that the source is updated as the user types (instead of on losing focus). But they can still use the save command before the data is valid (eg the mm part may still be blank).
I'd like for the XmlMaskedInput to show the red decorator and use the Validation.HasErrors attached property in this case. Is there any way for the control to do this out of the box?