I have a data object used to contain my UI data that supports INotifyPropertyChanged
and IDataErrorInfo
. Originally I had all of the UI controls di
Just to add to the answer provided, the error template can be set once in a resource dictionary. Just the triggers have to be copied & pasted for all the default styles of all the relevant element types.
For example:
Or, take it one step further and avoid the trigger repetition by combining the styles:
but I'd stay away from this approach as it will break the designer.
In the examples above I used the template named ValidationErrorTemplate
from MahApps.Metro
Also, don't forget to also use the AdornerDecorator
inside the TabItem
fix, as described by @Abyte0, in order to maintain the validations when tab switching.