There are some very important controls in Catel which help with visualizing the validation results.
...
A InfoBarMessageControl is automaticly automatically added to the DataWindow, if you want to use a different style for this InfoBarMessageControl, you must override the default style, add your own InfoBarMessageControl and disable the deafault default InfoBarMessageControl from the DataWindow.
- Create a custom style based on the default style.
- Change the x:Key from x:Key="{x:Type local:InfoBarMessageControl}" to x:Key="yourCustomStyleKey"
Set the InfoBarMessageControlGenerationMode to None
Code Block language c# /// <summary> /// Initializes a new instance of the <see cref="DataWindow"/> class. /// </summary> /// <param name="viewModel">The view model to inject.</param> /// <remarks> /// This constructor can be used to use view-model injection. /// </remarks> public DataWindow(DataWindowViewModel viewModel) : base(viewModel, DataWindowMode.Custom, null, DataWindowDefaultButton.None, true, InfoBarMessageControlGenerationMode.None) { InitializeComponent(); }
Add a new InfoBarMessageControl as root control to your DataWindow and set the style.
Code Block <catel:InfoBarMessageControl Style="{DynamicResource yourCustomStyleKey}"> <Grid> <catel:WarningAndErrorValidator Source="{Binding}" /> //Your content </Grid> </catel:InfoBarMessageControl>
...