I am using data binding and IDataErrorInfo style identity in the form. This form includes a Label control, for which I do not want to show a red decoration when validation fails. Can anyone recommend a way to remove this decoration from the Label controls?
You can get rid of the default validation error pattern by assigning an empty ControlTemplateproperty to an attached property Validation.ErrorTemplate.
ControlTemplate
Validation.ErrorTemplate
<Label Content="{Binding ...}"> <Validation.ErrorTemplate> <ControlTemplate /> </Validation.ErrorTemplate> </Label>
Hope this helps.
, . ValidatesOnNotifyDataErrors, ValidatesOnDataErrors ValidatesOnExceptions.
ValidatesOnNotifyDataErrors
ValidatesOnDataErrors
ValidatesOnExceptions
<Label Content="{Binding YOUR_BINDING_PROPERTY, ValidatesOnNotifyDataErrors=False, ValidatesOnDataErrors=False, ValidatesOnExceptions=False}" />
Source: https://habr.com/ru/post/1737450/More articles:Running FancyBox from DIV onclick (); - jqueryHow to center java.awt.FileDialog on screen - javaDataContractSerializer and deserialization of web service response types - c #Help with a logical problem - c #the question about the list cut list of lists - functionHow to redirect to current page in php? - redirectReset Open the Open File dialog box in Windows - windowsHow to get OperationDescription from OperationContext in AfterReceiveRequest in WCF? - wcftrack asp.net site in production - c #programming viewing of a surveillance camera in .net - c #All Articles