Quantcast
Channel: How can I match Visual Studio's theme when creating a VSIX tool window? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by Leo Liu for How can I match Visual Studio's theme when creating a VSIX tool window?

$
0
0

How can I match Visual Studio's theme when creating a VSIX tool window?

You can try to binding to static VS resources:

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:vs_shell="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.11.0"><Style TargetType="Label"><Setter Property="Foreground" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowTextBrushKey}}"/></Style><Style TargetType="TextBox"><Setter Property="Foreground" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowTextBrushKey}}"/><Setter Property="Background" Value="{DynamicResource {x:Static vs_shell:EnvironmentColors.ToolWindowBackgroundBrushKey}}"/></Style></ResourceDictionary>

See EnvironmentColors Class for more details.

Note: To get the exactly the same theme, you need use the exact XAML that VS uses. Thanks @GrantTheAnt.


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>