I use this method to set high contrast style in xaml:
<DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="True">
...
</DataTrigger>
But there're two main high contrast mode, black and white, how to set style for these two mode seperately?
I have a method that it can verify high contrast white and high contrast black. It work well in my project. I hope it can help you.
First, need new a DependencyProperty to judge if it is white or black.
Second, you can use it in trigger. But you do best to use it with SystemParameters.HighContrast. For example:
By the way, For startup your app correctly in the high contrast theme, you need add code in your MainWindow.xaml.cs to trigger manually.