是的,WPF技术。
如何在桌面WPF应用程序中获取用户在Windows设置中选择的强调颜色?
例如,对于按钮?
this.Background = SystemParameters.WindowGlassBrush;
请注意,该类中的属性标有 SecurityCriticalAttribute,因此您很可能需要完全信任来访问它们。
我想要理查德·普雷齐奥的回答的XAML版本,应该是:
BorderBrush="{Binding Source={x:Static SystemParameters.WindowGlassBrush}}"
<Setter Property="Foreground" Value="{x:Static SystemParameters.WindowGlassBrush}"/>
- Toni