Question

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.

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

Thanks in advance.

Was it helpful?

Solution

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}}"

where vsfx is

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

This approach solved this problem!

OTHER TIPS

If you want to detect the theme change event itself, you can make use of the VSColorTheme.ThemeChanged static event.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top