简体   繁体   English

如何找出Visual Studio主题颜色何时发生变化?

[英]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.

相关问题 如何找出我在Visual Studio 2017中使用的c#项目类型? - How can I find out what type of c# project I'm using in Visual Studio 2017? 写出表格时,如何在 Visual Studio 中创建外键关系? - How can I create a foreign key relationship in Visual Studio when writing out the tables? 当我尝试构建它时,Visual Studio会执行某些操作。 我如何找到留在这背后的代码? - Visual Studio executes something when i try to build it. How do i find out the code that stays behind this? 在 Visual Studio 2008 中单步执行 C# 时如何找到方法调用者? - How can I find a method caller when stepping through C# in Visual Studio 2008? 在Visual Studio扩展中更改“颜色主题” - Changing “Color theme” within a Visual Studio Extension C# Visual Studio Excel 加载项:如何检测 Excel Office 主题更改? - C# Visual Studio Excel Add-in: How can I detect Excel Office Theme Change? 如何在 Visual Studio 中为我的 forms 使用 Windows 10 主题? - How can I use the Windows 10 theme for my forms in Visual Studio? 在 Visual Studio 中调试时,我可以在返回之前找出返回值吗? - Can I find out the return value before returning while debugging in Visual Studio? Visual Studio:如何确定方法 A 是否可以从方法 B 到达? - Visual Studio: How to find out if Method A can be reached from Method B? 我可以从 Visual Studio git 更改中恢复丢弃的文件吗? - Can I restore discarded files from Visual studio git changes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM