TheOne
TheOne

Reputation: 177

Assign ValidatesOnDataErrors in a Style

I have a wpf form that has many controls. I'm doing all sort of validations on the user input and the source as well. I need to Set ValidatesOnDataErrors in Style. It is not recognizing the property ValidatesOnDataErrors.

<Style TargetType="TextBlock">
  <Setter Property="ValidatesOnDataErrors" Value="True" />
</Style> 

Upvotes: 2

Views: 153

Answers (1)

brunnerh
brunnerh

Reputation: 184376

It's a property on the Binding class, you can't set it in a style (because bindings cannot be styled).

Upvotes: 3

Related Questions