I found recently than the Validation Error Adorners on my WPF Project when used within a Tab Control, would disappear if I changed tabs.
After a little searching, I found this helpful post;
You basically need to wrap your Tab Control Tab Content within a Adorner Decorator as follows;
<Border>
<AdornerDecorator>
<StackPanel>
...
</StackPanel>
</AdornerDecorator>
</Border>
This “bug” is due to the fact that the Error Adorners are painted on the Adorner Layer, which is discarded when changing tabs. The code above preserves this layer, preventing the Adorners from being lost.
No comments:
Post a Comment