user982241
user982241

Reputation: 11

Set Validation.ErrorTemplate in code behind

How can I set the Validation.ErrorTemplate property in code behind?

Upvotes: 1

Views: 599

Answers (1)

WPF Lover
WPF Lover

Reputation: 91

Thats very straight forward.

You can use the below code,

Validation.SetErrorTemplate(this.editor, Resources["MyTemplate"] as ControlTemplate);

Regards,

Jawahar

Upvotes: 2

Related Questions