Skip to content

Commit d945d2e

Browse files
jizcKeboo
authored andcommitted
Fixed foreground brush on Light, Dark and Accent versions of CheckBox and RadioButton styles (#1543)
1 parent c1c328b commit d945d2e

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

MainDemo.Wpf/Toggles.xaml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<RowDefinition Height="Auto" />
1919
<RowDefinition Height="Auto" />
2020
<RowDefinition Height="Auto" />
21+
<RowDefinition Height="Auto" />
2122
</Grid.RowDefinitions>
2223
<Grid.ColumnDefinitions>
2324
<ColumnDefinition Width="Auto" />
@@ -113,7 +114,27 @@
113114
</CheckBox>
114115
</smtx:XamlDisplay>
115116
</StackPanel>
116-
<StackPanel Grid.Column="0" Grid.Row="3" Margin="0 24 0 0" Orientation="Horizontal">
117+
<StackPanel Grid.Column="0" Grid.Row="3" Margin="5 8 0 8" Orientation="Horizontal">
118+
<smtx:XamlDisplay Key="buttons_65">
119+
<RadioButton Style="{StaticResource MaterialDesignLightRadioButton}" IsChecked="True" Content="Light" />
120+
</smtx:XamlDisplay>
121+
<smtx:XamlDisplay Key="buttons_66" Margin="8 0 0 0">
122+
<RadioButton Style="{StaticResource MaterialDesignDarkRadioButton}" IsChecked="True" Content="Dark" />
123+
</smtx:XamlDisplay>
124+
<smtx:XamlDisplay Key="buttons_67" Margin="8 0 0 0">
125+
<RadioButton Style="{StaticResource MaterialDesignAccentRadioButton}" IsChecked="True" Content="Accent" />
126+
</smtx:XamlDisplay>
127+
<smtx:XamlDisplay Key="buttons_68" Margin="8 0 0 0">
128+
<CheckBox IsChecked="True" Style="{StaticResource MaterialDesignLightCheckBox}" Content="Light" />
129+
</smtx:XamlDisplay>
130+
<smtx:XamlDisplay Key="buttons_69" Margin="8 0 0 0">
131+
<CheckBox IsChecked="True" Style="{StaticResource MaterialDesignDarkCheckBox}" Content="Dark" />
132+
</smtx:XamlDisplay>
133+
<smtx:XamlDisplay Key="buttons_70" Margin="8 0 0 0">
134+
<CheckBox IsChecked="True" Style="{StaticResource MaterialDesignAccentCheckBox}" Content="Accent" />
135+
</smtx:XamlDisplay>
136+
</StackPanel>
137+
<StackPanel Grid.Column="0" Grid.Row="4" Margin="0 24 0 0" Orientation="Horizontal">
117138
<smtx:XamlDisplay Key="buttons_46" VerticalAlignment="Center" Margin="5 0 0 0">
118139
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" ToolTip="Default ToggleButton Style"/>
119140
</smtx:XamlDisplay>
@@ -160,7 +181,7 @@
160181
</ToggleButton>
161182
</smtx:XamlDisplay>
162183
</StackPanel>
163-
<StackPanel Grid.Column="0" Grid.Row="4" Margin="0 24 0 0" Orientation="Horizontal">
184+
<StackPanel Grid.Column="0" Grid.Row="5" Margin="0 24 0 0" Orientation="Horizontal">
164185
<smtx:XamlDisplay Key="buttons_53" Margin="5 0 0 0" VerticalAlignment="Center">
165186
<ToggleButton Style="{StaticResource MaterialDesignFlatToggleButton}" ToolTip="MaterialDesignFlatToggleButton">
166187
<materialDesign:PackIcon Kind="Paperclip" Height="21" Width="21" />
@@ -205,7 +226,7 @@
205226
</ListBoxItem>
206227
</ListBox>
207228
</smtx:XamlDisplay>
208-
<smtx:XamlDisplay Key="buttons_57" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Left" Margin="0 24 0 0">
229+
<smtx:XamlDisplay Key="buttons_57" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Left" Margin="0 24 0 0">
209230
<ListBox SelectionMode="Extended" Style="{StaticResource MaterialDesignToolToggleFlatListBox}">
210231
<ListBox.ToolTip>
211232
<StackPanel>
@@ -225,7 +246,7 @@
225246
</ListBoxItem>
226247
</ListBox>
227248
</smtx:XamlDisplay>
228-
<StackPanel Grid.Column="1" Grid.Row="4" Margin="0 24 0 0">
249+
<StackPanel Grid.Column="1" Grid.Row="5" Margin="0 24 0 0">
229250
<smtx:XamlDisplay Key="buttons_60" HorizontalAlignment="Left">
230251
<StackPanel Orientation="Horizontal" Margin="4">
231252
<RadioButton Style="{StaticResource MaterialDesignTabRadioButton}" Margin="4" IsChecked="True" Content="FIRST"/>
@@ -244,9 +265,9 @@
244265
</smtx:XamlDisplay>
245266

246267
</StackPanel>
247-
<Border Margin="0 24 0 0" BorderThickness="0 1 0 0" BorderBrush="{DynamicResource MaterialDesignDivider}" Grid.Row="5" Grid.ColumnSpan="2" />
248-
<TextBlock Grid.Row="6" Style="{StaticResource MaterialDesignHeadline5TextBlock}" Margin="0 24">Checkboxes</TextBlock>
249-
<smtx:XamlDisplay Key="fields_31" Grid.Row="7" HorizontalAlignment="Left">
268+
<Border Margin="0 24 0 0" BorderThickness="0 1 0 0" BorderBrush="{DynamicResource MaterialDesignDivider}" Grid.Row="6" Grid.ColumnSpan="2" />
269+
<TextBlock Grid.Row="7" Style="{StaticResource MaterialDesignHeadline5TextBlock}" Margin="0 24">Checkboxes</TextBlock>
270+
<smtx:XamlDisplay Key="fields_31" Grid.Row="8" HorizontalAlignment="Left">
250271
<StackPanel Margin="8 0">
251272
<CheckBox IsChecked="True">Checked</CheckBox>
252273
<CheckBox IsChecked="False">Unchecked</CheckBox>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.CheckBox.xaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,16 @@
140140
<Style x:Key="MaterialDesignLightCheckBox" TargetType="{x:Type CheckBox}" BasedOn="{StaticResource MaterialDesignCheckBox}">
141141
<Setter Property="Background" Value="{DynamicResource PrimaryHueLightBrush}"/>
142142
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueLightBrush}"/>
143-
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueLightForegroundBrush}"/>
144143
</Style>
145144

146145
<Style x:Key="MaterialDesignDarkCheckBox" TargetType="{x:Type CheckBox}" BasedOn="{StaticResource MaterialDesignCheckBox}">
147146
<Setter Property="Background" Value="{DynamicResource PrimaryHueDarkBrush}"/>
148147
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueDarkBrush}"/>
149-
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueDarkForegroundBrush}"/>
150148
</Style>
151149

152150
<Style x:Key="MaterialDesignAccentCheckBox" TargetType="{x:Type CheckBox}" BasedOn="{StaticResource MaterialDesignCheckBox}">
153151
<Setter Property="Background" Value="{DynamicResource SecondaryAccentBrush}"/>
154152
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryAccentBrush}"/>
155-
<Setter Property="Foreground" Value="{DynamicResource SecondaryAccentForegroundBrush}"/>
156153
</Style>
157154

158155
<Style x:Key="MaterialDesignUserForegroundCheckBox" TargetType="{x:Type CheckBox}">

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.RadioButton.xaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,16 @@
121121
<Style x:Key="MaterialDesignLightRadioButton" TargetType="{x:Type RadioButton}" BasedOn="{StaticResource MaterialDesignRadioButton}">
122122
<Setter Property="Background" Value="{DynamicResource PrimaryHueLightBrush}"/>
123123
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueLightBrush}"/>
124-
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueLightForegroundBrush}"/>
125124
</Style>
126125

127126
<Style x:Key="MaterialDesignDarkRadioButton" TargetType="{x:Type RadioButton}" BasedOn="{StaticResource MaterialDesignRadioButton}">
128127
<Setter Property="Background" Value="{DynamicResource PrimaryHueDarkBrush}"/>
129128
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueDarkBrush}"/>
130-
<Setter Property="Foreground" Value="{DynamicResource PrimaryHueDarkForegroundBrush}"/>
131129
</Style>
132130

133131
<Style x:Key="MaterialDesignAccentRadioButton" TargetType="{x:Type RadioButton}" BasedOn="{StaticResource MaterialDesignRadioButton}">
134132
<Setter Property="Background" Value="{DynamicResource SecondaryAccentBrush}"/>
135133
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryAccentBrush}"/>
136-
<Setter Property="Foreground" Value="{DynamicResource SecondaryAccentForegroundBrush}"/>
137134
</Style>
138135

139136
<Style x:Key="MaterialDesignUserForegroundRadioButton" TargetType="{x:Type RadioButton}">

0 commit comments

Comments
 (0)