简体   繁体   English

VSPackage主题色

[英]VSPackage theme-colored

I built a VSPackage for VS2015. 我为VS2015构建了VSPackage。 How can I get the current theme colors to color my elements appropriate? 如何获得当前的主题颜色以适当地为我的元素上色? I tried things like 我尝试过类似的事情

 xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.14.0"
 Background="{DynamicResource {x:Static vsfx:VsBrushes.CommandBarOptionsBackgroundKey}}"

But that didn't work. 但这没有用。 Any help appreciated. 任何帮助表示赞赏。

Thanks! 谢谢!

This worked for me: 这对我有用:

xmlns:vs_shell="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
Background="{DynamicResource {x:Static vs_shell:EnvironmentColors.CommandBarMenuBackgroundGradientBrushKey}}"

You can get the full list of colors here: Microsoft.VisualStudio.PlatformUI.EnvironmentColors 您可以在此处获得颜色的完整列表: Microsoft.VisualStudio.PlatformUI.EnvironmentColors

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM