[英]How can I find out when Visual Studio theme color changes?
I develop the Visual Studio package with a tool window. 我用工具窗口开发Visual Studio包。 The UI of the tool window is based on WPF.
工具窗口的UI基于WPF。 In my user control I want to use current Visual Studio theme colors corresponding to the VS design.
在我的用户控件中,我想使用与VS设计相对应的当前Visual Studio主题颜色。
Therefore my question is how I can find out that Visual Studio theme color has been changed? 因此我的问题是如何才能发现Visual Studio主题颜色已被更改?
Thanks in advance. 提前致谢。
I've found another way to do it. 我找到了另一种方法。 I can use visual studio theme colors resources from xaml directly.
我可以直接使用xaml的visual studio主题颜色资源。 For example:
例如:
Background="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}"
where vsfx is vsfx在哪里
xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.10.0"
This approach solved this problem! 这种方法解决了这个问题!
如果要检测主题更改事件本身,可以使用VSColorTheme.ThemeChanged
静态事件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.