I'need to create a Visual Studio Extension with a tool window similar to Visual Studio Error window. I have added a ListView control inside a tool window to get the appearance.
I have implemented the following to change the color based on selected Visual Studio Theme (When Light selected fonts will be black and background will be white and when Theme is black other way). I'm not confided with this approach. Is there a way to inherit styles from the Visual Studio IDE Theme to the tool window? Please suggest any better alternatives.
<UserControl x:Class="VsixSample.ToolWindow1Control"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Background="{DynamicResource VsBrush.Window}"
Foreground="{DynamicResource VsBrush.WindowText}"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Name="MyToolWindow">
<Grid>
<ListView Margin="10" Name="lvUsers" Background="Transparent" Foreground="{DynamicResource VsBrush.WindowText}">
<ListView.View>
<GridView >
<GridViewColumn Header="Name" Width="120" DisplayMemberBinding="{Binding Name}" />
<GridViewColumn Header="Age" Width="50" DisplayMemberBinding="{Binding Age}" />
<GridViewColumn Header="Mail" Width="150" DisplayMemberBinding="{Binding Mail}" />
</GridView>
</ListView.View>
</ListView>
</Grid>
</UserControl>