Reputation: 170
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?
Upvotes: 3
Views: 97
Reputation: 170
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.
Upvotes: 3