In my application resources I have the following style defined, well, I'm giving you the simplistic version (style is meant to be applied to all windows across the application):
<Style TargetType="{x:Type Window}" BasedOn="{StaticResource {x:Type Window}}">
<Setter Property="Template">
<!--Omitting irrelevant property setters-->
<Setter.Value>
<ControlTemplate TargetType="{x:Type Window}">
<StackPanel>
<ContentPresenter/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
I've noticed that when this style gets applied to all windows, validation errors (IDataErrorInfo) — by means of the default red-border-box-around-control error template — aren't displayed in those windows.
What gives?
Wrapping the window template (StackPanel in this example) into an AdornerDecorator solved this (as the decorator is used to display validation errors).
Thanks to Will, I didn't even know what to look for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With