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.
Here's how to change it to a different color theme. On the menu bar, select Tools > Options. In the options list, select Environment > General. In the Color theme list, choose between the default Dark theme, the Blue theme, the Blue (Extra Contrast) theme, and the Light theme.
Visual Studio themes Users are prompted to select a theme during their first use of Visual Studio and are able to switch themes later by going to Tools > Options > Environment > General and choosing a new theme from the "color theme" drop-down menu.
Dark (best colors for minimized eye strain)🌃 Neon ~ (for Cyberpunk Lovers) 😉 Sunset Red (Red is soothing for eyes and helps to sleep better) 🌇 Night Owl (inspired by Sarah Drasner's Night Owl Theme)🦉
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!
If you want to detect the theme change event itself, you can make use of the VSColorTheme.ThemeChanged
static event.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With