Skip to content

Commit 0287249

Browse files
committed
Fix selection and text editing colors in datagrids
1 parent e9528da commit 0287249

File tree

3 files changed

+33
-18
lines changed

3 files changed

+33
-18
lines changed

solution/GraphicalDebugging/GeometryWatchControl.xaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,12 @@
7575
<!--Override Highlighting so that its easy to see what is selected even when the control is not focused-->
7676
<Style.Triggers>
7777
<Trigger Property="IsSelected" Value="True">
78-
<Setter Property="Background" Value="{x:Static SystemColors.HighlightBrush}" />
79-
<Setter Property="Foreground" Value="{x:Static SystemColors.HighlightTextBrush}" />
80-
<Setter Property="BorderBrush" Value="{x:Static SystemColors.HighlightBrush}" />
78+
<Setter Property="Background" Value="{DynamicResource VsBrush.Highlight}" />
79+
<Setter Property="Foreground" Value="{DynamicResource VsBrush.HighlightText}" />
8180
</Trigger>
8281
<Trigger Property="IsSelected" Value="False">
8382
<Setter Property="Background" Value="{DynamicResource VsBrush.ToolWindowBackground}" />
8483
<Setter Property="Foreground" Value="{DynamicResource VsBrush.ToolWindowText}" />
85-
<Setter Property="BorderBrush" Value="{DynamicResource VsBrush.ToolWindowBorder}" />
8684
</Trigger>
8785
<MultiDataTrigger>
8886
<MultiDataTrigger.Conditions>
@@ -92,14 +90,21 @@
9290
<MultiDataTrigger.Setters>
9391
<Setter Property="Background" Value="{DynamicResource VsBrush.ToolWindowBackground}" />
9492
<Setter Property="Foreground" Value="{DynamicResource VsBrush.ToolWindowText}" />
95-
<Setter Property="BorderBrush" Value="{DynamicResource VsBrush.ToolWindowBorder}" />
9693
</MultiDataTrigger.Setters>
9794
</MultiDataTrigger>
9895
</Style.Triggers>
9996
</Style>
10097
</DataGrid.CellStyle>
10198
<DataGrid.Columns>
102-
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="100" />
99+
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="100">
100+
<DataGridTextColumn.EditingElementStyle>
101+
<Style TargetType="TextBox">
102+
<Setter Property="BorderThickness" Value="0" />
103+
<Setter Property="Background" Value="{DynamicResource VsBrush.ToolWindowBackground}" />
104+
<Setter Property="Foreground" Value="{DynamicResource VsBrush.ToolWindowText}" />
105+
</Style>
106+
</DataGridTextColumn.EditingElementStyle>
107+
</DataGridTextColumn>
103108
<DataGridCheckBoxColumn Binding="{Binding IsEnabled, UpdateSourceTrigger=PropertyChanged}"/>
104109
<DataGridTemplateColumn Header="Color" Width="50">
105110
<DataGridTemplateColumn.CellTemplate>

solution/GraphicalDebugging/GraphicalWatchControl.xaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,12 @@
5555
<!--Override Highlighting so that its easy to see what is selected even when the control is not focused-->
5656
<Style.Triggers>
5757
<Trigger Property="IsSelected" Value="True">
58-
<Setter Property="Background" Value="{x:Static SystemColors.HighlightBrush}" />
59-
<Setter Property="Foreground" Value="{x:Static SystemColors.HighlightTextBrush}" />
60-
<Setter Property="BorderBrush" Value="{x:Static SystemColors.HighlightBrush}" />
58+
<Setter Property="Background" Value="{DynamicResource VsBrush.Highlight}" />
59+
<Setter Property="Foreground" Value="{DynamicResource VsBrush.HighlightText}" />
6160
</Trigger>
6261
<Trigger Property="IsSelected" Value="False">
6362
<Setter Property="Background" Value="{DynamicResource VsBrush.ToolWindowBackground}" />
6463
<Setter Property="Foreground" Value="{DynamicResource VsBrush.ToolWindowText}" />
65-
<Setter Property="BorderBrush" Value="{DynamicResource VsBrush.ToolWindowBorder}" />
6664
</Trigger>
6765
<MultiDataTrigger>
6866
<MultiDataTrigger.Conditions>
@@ -72,14 +70,21 @@
7270
<MultiDataTrigger.Setters>
7371
<Setter Property="Background" Value="{DynamicResource VsBrush.ToolWindowBackground}" />
7472
<Setter Property="Foreground" Value="{DynamicResource VsBrush.ToolWindowText}" />
75-
<Setter Property="BorderBrush" Value="{DynamicResource VsBrush.ToolWindowBorder}" />
7673
</MultiDataTrigger.Setters>
7774
</MultiDataTrigger>
7875
</Style.Triggers>
7976
</Style>
8077
</DataGrid.CellStyle>
8178
<DataGrid.Columns>
82-
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="101" />
79+
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="101">
80+
<DataGridTextColumn.EditingElementStyle>
81+
<Style TargetType="TextBox">
82+
<Setter Property="BorderThickness" Value="0" />
83+
<Setter Property="Background" Value="{DynamicResource VsBrush.ToolWindowBackground}" />
84+
<Setter Property="Foreground" Value="{DynamicResource VsBrush.ToolWindowText}" />
85+
</Style>
86+
</DataGridTextColumn.EditingElementStyle>
87+
</DataGridTextColumn>
8388
<DataGridTemplateColumn Header="Image" Width="101">
8489
<DataGridTemplateColumn.CellTemplate>
8590
<DataTemplate>

solution/GraphicalDebugging/PlotWatchControl.xaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,12 @@
7575
<!--Override Highlighting so that its easy to see what is selected even when the control is not focused-->
7676
<Style.Triggers>
7777
<Trigger Property="IsSelected" Value="True">
78-
<Setter Property="Background" Value="{x:Static SystemColors.HighlightBrush}" />
79-
<Setter Property="Foreground" Value="{x:Static SystemColors.HighlightTextBrush}" />
80-
<Setter Property="BorderBrush" Value="{x:Static SystemColors.HighlightBrush}" />
78+
<Setter Property="Background" Value="{DynamicResource VsBrush.Highlight}" />
79+
<Setter Property="Foreground" Value="{DynamicResource VsBrush.HighlightText}" />
8180
</Trigger>
8281
<Trigger Property="IsSelected" Value="False">
8382
<Setter Property="Background" Value="{DynamicResource VsBrush.ToolWindowBackground}" />
8483
<Setter Property="Foreground" Value="{DynamicResource VsBrush.ToolWindowText}" />
85-
<Setter Property="BorderBrush" Value="{DynamicResource VsBrush.ToolWindowBorder}" />
8684
</Trigger>
8785
<MultiDataTrigger>
8886
<MultiDataTrigger.Conditions>
@@ -92,14 +90,21 @@
9290
<MultiDataTrigger.Setters>
9391
<Setter Property="Background" Value="{DynamicResource VsBrush.ToolWindowBackground}" />
9492
<Setter Property="Foreground" Value="{DynamicResource VsBrush.ToolWindowText}" />
95-
<Setter Property="BorderBrush" Value="{DynamicResource VsBrush.ToolWindowBorder}" />
9693
</MultiDataTrigger.Setters>
9794
</MultiDataTrigger>
9895
</Style.Triggers>
9996
</Style>
10097
</DataGrid.CellStyle>
10198
<DataGrid.Columns>
102-
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="100" />
99+
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="100">
100+
<DataGridTextColumn.EditingElementStyle>
101+
<Style TargetType="TextBox">
102+
<Setter Property="BorderThickness" Value="0" />
103+
<Setter Property="Background" Value="{DynamicResource VsBrush.ToolWindowBackground}" />
104+
<Setter Property="Foreground" Value="{DynamicResource VsBrush.ToolWindowText}" />
105+
</Style>
106+
</DataGridTextColumn.EditingElementStyle>
107+
</DataGridTextColumn>
103108
<DataGridCheckBoxColumn Binding="{Binding IsEnabled, UpdateSourceTrigger=PropertyChanged}"/>
104109
<DataGridTemplateColumn Header="Color" Width="50">
105110
<DataGridTemplateColumn.CellTemplate>

0 commit comments

Comments
 (0)