VSPackage theme-colored

122 views Asked by At

I built a VSPackage for VS2015. 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!

1

There are 1 answers

0
sboulema On

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