我怎样才能找出何时Visual Studio的主题颜色的变化? [英] How can I find out when Visual Studio theme color changes?

查看:223
本文介绍了我怎样才能找出何时Visual Studio的主题颜色的变化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发的Visual Studio包工具窗口。工具窗口的UI是基于WPF。
在我的用户控制我想用对应VS设计当前的Visual Studio的主题颜色。

I develop the Visual Studio package with a tool window. The UI of the tool window is based on WPF. In my user control I want to use current Visual Studio theme colors corresponding to the VS design.

所以我的问题是我怎么能找出的Visual Studio主题颜色已经改变?

Therefore my question is how I can find out that Visual Studio theme color has been changed?

先谢谢了。

推荐答案

我找到了另一种方式来做到这一点。我可以从XAML直接使用Visual Studio的主题颜色资源。
例如:

I've found another way to do it. I can use visual studio theme colors resources from xaml directly. For example:

Background="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}"

其中vsfx为

xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.10.0"

这方法解决了这个问题!

This approach solved this problem!

这篇关于我怎样才能找出何时Visual Studio的主题颜色的变化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆