In my current project, I use several text field controls, the contents of which are populated from objects coming from the database. The object uses validation to verify that text is inserted correctly.
When I want to show a validation error (i.e. the text has many characters), I have to add some binding options to the text property, as in the following line:
<TextBox Text="{Binding Mode=TwoWay, Path=Description, ValidatesOnDataErrors=True, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged}" />
Is it possible to create a template or style or something else to change the default values ββfor the last three parameters (ValidatesOnDataErrors, NotifyOnValidationError, UpdateSourceTrigger) for values ββsimilar to the above? Textbox controls should look like this:
<TextBox Text="{Binding Mode=TwoWay, Path=Description}" />
source
share