Skip to content

Commit f8e1423

Browse files
authored
Change ChoiceChip and FilterChip TargetType to ToggleButton (#3665)
1 parent f949287 commit f8e1423

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.CheckBox.xaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@
310310
<Setter Property="VerticalContentAlignment" Value="Center" />
311311
</Style>
312312

313-
<Style x:Key="MaterialDesignFilterChipCheckBox" TargetType="CheckBox">
313+
<Style x:Key="MaterialDesignFilterChipCheckBox" TargetType="ToggleButton">
314314
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />
315315
<Setter Property="BorderThickness" Value="0" />
316316
<Setter Property="Cursor" Value="Hand" />
@@ -323,7 +323,7 @@
323323
<Setter Property="SnapsToDevicePixels" Value="True" />
324324
<Setter Property="Template">
325325
<Setter.Value>
326-
<ControlTemplate TargetType="{x:Type CheckBox}">
326+
<ControlTemplate TargetType="{x:Type ToggleButton}">
327327
<ControlTemplate.Resources>
328328
<Style TargetType="{x:Type wpf:PackIcon}">
329329
<Setter Property="FrameworkElement.Height" Value="22" />
@@ -480,7 +480,7 @@
480480
</Setter>
481481
</Style>
482482

483-
<Style x:Key="MaterialDesignFilterChipOutlineCheckBox" TargetType="CheckBox">
483+
<Style x:Key="MaterialDesignFilterChipOutlineCheckBox" TargetType="ToggleButton">
484484
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.ForegroundLight}" />
485485
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />
486486
<Setter Property="BorderThickness" Value="1" />
@@ -494,7 +494,7 @@
494494
<Setter Property="SnapsToDevicePixels" Value="True" />
495495
<Setter Property="Template">
496496
<Setter.Value>
497-
<ControlTemplate TargetType="{x:Type CheckBox}">
497+
<ControlTemplate TargetType="{x:Type ToggleButton}">
498498
<ControlTemplate.Resources>
499499
<Style TargetType="{x:Type wpf:PackIcon}">
500500
<Setter Property="FrameworkElement.Height" Value="22" />
@@ -674,7 +674,7 @@
674674
</Style>
675675

676676
<Style x:Key="MaterialDesignFilterChipPrimaryCheckBox"
677-
TargetType="CheckBox"
677+
TargetType="ToggleButton"
678678
BasedOn="{StaticResource MaterialDesignFilterChipCheckBox}">
679679
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary.Light}" />
680680
<Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Primary.Dark}" />
@@ -693,7 +693,7 @@
693693
</Style>
694694

695695
<Style x:Key="MaterialDesignFilterChipSecondaryCheckBox"
696-
TargetType="CheckBox"
696+
TargetType="ToggleButton"
697697
BasedOn="{StaticResource MaterialDesignFilterChipCheckBox}">
698698
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Secondary.Light}" />
699699
<Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Secondary.Dark}" />
@@ -712,7 +712,7 @@
712712
</Style>
713713

714714
<Style x:Key="MaterialDesignFilterChipPrimaryOutlineCheckBox"
715-
TargetType="CheckBox"
715+
TargetType="ToggleButton"
716716
BasedOn="{StaticResource MaterialDesignFilterChipOutlineCheckBox}">
717717
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary.Light}" />
718718
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
@@ -732,7 +732,7 @@
732732
</Style>
733733

734734
<Style x:Key="MaterialDesignFilterChipSecondaryOutlineCheckBox"
735-
TargetType="CheckBox"
735+
TargetType="ToggleButton"
736736
BasedOn="{StaticResource MaterialDesignFilterChipOutlineCheckBox}">
737737
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Secondary.Light}" />
738738
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Secondary}" />

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.RadioButton.xaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@
493493
</Style>
494494

495495

496-
<Style x:Key="MaterialDesignChoiceChipRadioButton" TargetType="{x:Type RadioButton}">
496+
<Style x:Key="MaterialDesignChoiceChipRadioButton" TargetType="{x:Type ToggleButton}">
497497
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />
498498
<Setter Property="BorderThickness" Value="0" />
499499
<Setter Property="Cursor" Value="Hand" />
@@ -506,7 +506,7 @@
506506
<Setter Property="SnapsToDevicePixels" Value="True" />
507507
<Setter Property="Template">
508508
<Setter.Value>
509-
<ControlTemplate TargetType="{x:Type RadioButton}">
509+
<ControlTemplate TargetType="{x:Type ToggleButton}">
510510
<ControlTemplate.Resources>
511511
<Style TargetType="{x:Type wpf:PackIcon}">
512512
<Setter Property="FrameworkElement.Height" Value="22" />
@@ -631,7 +631,7 @@
631631
</Setter>
632632
</Style>
633633

634-
<Style x:Key="MaterialDesignChoiceChipOutlineRadioButton" TargetType="{x:Type RadioButton}">
634+
<Style x:Key="MaterialDesignChoiceChipOutlineRadioButton" TargetType="{x:Type ToggleButton}">
635635
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.ForegroundLight}" />
636636
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />
637637
<Setter Property="BorderThickness" Value="1" />
@@ -645,7 +645,7 @@
645645
<Setter Property="SnapsToDevicePixels" Value="True" />
646646
<Setter Property="Template">
647647
<Setter.Value>
648-
<ControlTemplate TargetType="{x:Type RadioButton}">
648+
<ControlTemplate TargetType="{x:Type ToggleButton}">
649649
<ControlTemplate.Resources>
650650
<Style TargetType="{x:Type wpf:PackIcon}">
651651
<Setter Property="FrameworkElement.Height" Value="22" />
@@ -793,7 +793,7 @@
793793
</Style>
794794

795795
<Style x:Key="MaterialDesignChoiceChipPrimaryRadioButton"
796-
TargetType="{x:Type RadioButton}"
796+
TargetType="{x:Type ToggleButton}"
797797
BasedOn="{StaticResource MaterialDesignChoiceChipRadioButton}">
798798
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary.Light}" />
799799
<Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Primary.Dark}" />
@@ -812,7 +812,7 @@
812812
</Style>
813813

814814
<Style x:Key="MaterialDesignChoiceChipSecondaryRadioButton"
815-
TargetType="{x:Type RadioButton}"
815+
TargetType="{x:Type ToggleButton}"
816816
BasedOn="{StaticResource MaterialDesignChoiceChipRadioButton}">
817817
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Secondary.Light}" />
818818
<Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Secondary.Dark}" />
@@ -831,7 +831,7 @@
831831
</Style>
832832

833833
<Style x:Key="MaterialDesignChoiceChipPrimaryOutlineRadioButton"
834-
TargetType="{x:Type RadioButton}"
834+
TargetType="{x:Type ToggleButton}"
835835
BasedOn="{StaticResource MaterialDesignChoiceChipOutlineRadioButton}">
836836
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary.Light}" />
837837
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
@@ -851,7 +851,7 @@
851851
</Style>
852852

853853
<Style x:Key="MaterialDesignChoiceChipSecondaryOutlineRadioButton"
854-
TargetType="{x:Type RadioButton}"
854+
TargetType="{x:Type ToggleButton}"
855855
BasedOn="{StaticResource MaterialDesignChoiceChipOutlineRadioButton}">
856856
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Secondary.Light}" />
857857
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Secondary}" />

0 commit comments

Comments
 (0)