Skip to content

Commit 5a46111

Browse files
authored
Removing all usage of "Accent" from the library (#3409)
Switched to use Secondary as the preferred term
1 parent eae3144 commit 5a46111

File tree

210 files changed

+1722
-1822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+1722
-1822
lines changed

MahMaterialDragablzMashUp/PaletteSelector.xaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
xmlns:mahMaterialDragablzMashUp="clr-namespace:MahMaterialDragablzMashUp"
66
xmlns:materialDesignColors="clr-namespace:MaterialDesignColors;assembly=MaterialDesignColors"
77
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8-
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
8+
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf" xmlns:materialDesignMahApps="http://materialdesigninxaml.net/winfx/xaml/themes"
99
d:DataContext="{d:DesignInstance mahMaterialDragablzMashUp:PaletteSelectorViewModel,
1010
IsDesignTimeCreatable=False}"
1111
d:DesignHeight="300"
1212
d:DesignWidth="300"
1313
mc:Ignorable="d">
1414
<UserControl.Resources>
1515
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
16+
<materialDesignMahApps:NullableToVisibilityConverter x:Key="NullableToVisibilityConverter" />
1617
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
1718
<Setter Property="CommandParameter" Value="{Binding}" />
1819
<Setter Property="Foreground">
@@ -66,13 +67,13 @@
6667
<Border Grid.Row="1"
6768
Grid.Column="1"
6869
Width="120"
69-
Visibility="{Binding IsAccented, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneTime}">
70+
Visibility="{Binding SecondaryExemplarHue, Converter={StaticResource NullableToVisibilityConverter}, Mode=OneTime}">
7071
<Border.Background>
71-
<SolidColorBrush Color="{Binding AccentExemplarHue.Color, Mode=OneTime}" />
72+
<SolidColorBrush Color="{Binding SecondaryExemplarHue.Color, Mode=OneTime}" />
7273
</Border.Background>
73-
<Button Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type mahMaterialDragablzMashUp:PaletteSelector}}, Path=DataContext.ApplyAccentCommand, Mode=OneTime}" CommandParameter="{Binding}">
74+
<Button Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type mahMaterialDragablzMashUp:PaletteSelector}}, Path=DataContext.ApplySecondaryCommand, Mode=OneTime}" CommandParameter="{Binding}">
7475
<StackPanel Orientation="Horizontal">
75-
<TextBlock Text="Accent" />
76+
<TextBlock Text="Secondary" />
7677
<Viewbox Width="16" Height="16">
7778
<Canvas Width="24" Height="24">
7879
<Path Style="{StaticResource PalettePath}" />

MahMaterialDragablzMashUp/PaletteSelectorViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public PaletteSelectorViewModel()
2525

2626
public ICommand ApplyPrimaryCommand { get; } = new AnotherCommandImplementation(o => ApplyPrimary((Swatch)o!));
2727

28-
public ICommand ApplyAccentCommand { get; } = new AnotherCommandImplementation(o => ApplyAccent((Swatch)o!));
28+
public ICommand ApplySecondaryCommand { get; } = new AnotherCommandImplementation(o => ApplySecondary((Swatch)o!));
2929

3030
private bool _isDarkTheme;
3131
public bool IsDarkTheme
@@ -64,11 +64,11 @@ private static void ApplyBase(bool isDark)
6464
private static void ApplyPrimary(Swatch swatch)
6565
=> ModifyTheme(theme => theme.SetPrimaryColor(swatch.ExemplarHue.Color));
6666

67-
private static void ApplyAccent(Swatch swatch)
67+
private static void ApplySecondary(Swatch swatch)
6868
{
69-
if (swatch.AccentExemplarHue is Hue accentHue)
69+
if (swatch.SecondaryExemplarHue is Hue secondaryHue)
7070
{
71-
ModifyTheme(theme => theme.SetSecondaryColor(accentHue.Color));
71+
ModifyTheme(theme => theme.SetSecondaryColor(secondaryHue.Color));
7272
}
7373
}
7474

MainDemo.Wpf/App.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<!--
2525
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
2626
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
27-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
27+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Secondary/MaterialDesignColor.Lime.xaml" />
2828
-->
2929

3030

MainDemo.Wpf/App.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ protected override void OnStartup(StartupEventArgs e)
1919

2020
//This is an alternate way to initialize MaterialDesignInXAML if you don't use the MaterialDesignResourceDictionary in App.xaml
2121
//Color primaryColor = SwatchHelper.Lookup[MaterialDesignColor.DeepPurple];
22-
//Color accentColor = SwatchHelper.Lookup[MaterialDesignColor.Lime];
23-
//ITheme theme = Theme.Create(new MaterialDesignLightTheme(), primaryColor, accentColor);
22+
//Color secondaryColor = SwatchHelper.Lookup[MaterialDesignColor.Lime];
23+
//ITheme theme = Theme.Create(new MaterialDesignLightTheme(), primaryColor, secondaryColor);
2424
//Resources.SetTheme(theme);
2525

2626

MainDemo.Wpf/Domain/PaletteSelectorViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ public PaletteSelectorViewModel()
1717
private static void ApplyPrimary(Swatch swatch)
1818
=> ModifyTheme(theme => theme.SetPrimaryColor(swatch.ExemplarHue.Color));
1919

20-
public ICommand ApplyAccentCommand { get; } = new AnotherCommandImplementation(o => ApplyAccent((Swatch)o!));
20+
public ICommand ApplySecondaryCommand { get; } = new AnotherCommandImplementation(o => ApplySecondary((Swatch)o!));
2121

22-
private static void ApplyAccent(Swatch swatch)
22+
private static void ApplySecondary(Swatch swatch)
2323
{
24-
if (swatch is { AccentExemplarHue: not null })
24+
if (swatch is { SecondaryExemplarHue: not null })
2525
{
26-
ModifyTheme(theme => theme.SetSecondaryColor(swatch.AccentExemplarHue.Color));
26+
ModifyTheme(theme => theme.SetSecondaryColor(swatch.SecondaryExemplarHue.Color));
2727
}
2828
}
2929

MainDemo.Wpf/Palette.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
Grid.Column="0"
5757
Grid.ColumnSpan="3"
5858
Background="{DynamicResource SecondaryHueMidBrush}">
59-
<TextBlock Foreground="{DynamicResource SecondaryHueMidForegroundBrush}" Text="Accent" />
59+
<TextBlock Foreground="{DynamicResource SecondaryHueMidForegroundBrush}" Text="Secondary" />
6060
</Border>
6161
</Grid>
6262
</UserControl>

MainDemo.Wpf/PaletteSelector.xaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
xmlns:local="clr-namespace:MaterialDesignDemo"
77
xmlns:materialDesignColors="clr-namespace:MaterialDesignColors;assembly=MaterialDesignColors"
88
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9-
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
9+
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
1010
d:DataContext="{d:DesignInstance domain:PaletteSelectorViewModel}"
1111
d:DesignHeight="300"
1212
d:DesignWidth="400"
1313
mc:Ignorable="d">
1414
<UserControl.Resources>
15+
<materialDesign:NullableToVisibilityConverter x:Key="NullableToVisibilityConverter" />
1516
<DataTemplate DataType="{x:Type materialDesignColors:Swatch}">
1617
<DataTemplate.Resources>
1718
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
@@ -72,14 +73,14 @@
7273
<Border Grid.Row="1"
7374
Grid.Column="1"
7475
Width="120"
75-
Visibility="{Binding IsAccented, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneTime}">
76+
Visibility="{Binding SecondaryExemplarHue, Converter={StaticResource NullableToVisibilityConverter}, Mode=OneTime}">
7677
<Border.Background>
77-
<SolidColorBrush Color="{Binding AccentExemplarHue.Color, Mode=OneTime}" />
78+
<SolidColorBrush Color="{Binding SecondaryExemplarHue.Color, Mode=OneTime}" />
7879
</Border.Background>
7980

80-
<Button Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PaletteSelector}}, Path=DataContext.ApplyAccentCommand, Mode=OneTime}" CommandParameter="{Binding}">
81+
<Button Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PaletteSelector}}, Path=DataContext.ApplySecondaryCommand, Mode=OneTime}" CommandParameter="{Binding}">
8182
<StackPanel Orientation="Horizontal">
82-
<TextBlock Text="Accent" />
83+
<TextBlock Text="Secondary" />
8384
<Viewbox Width="16" Height="16">
8485
<Canvas Width="24" Height="24">
8586
<Path Style="{StaticResource PalettePath}" />

MaterialDesign3.Demo.Wpf/App.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<!-- You can also use the built in theme dictionaries as well
2424
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
2525
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
26-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
26+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Secondary/MaterialDesignColor.Lime.xaml" />
2727
-->
2828

2929
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign3.Defaults.xaml" />

MaterialDesign3.Demo.Wpf/App.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ protected override void OnStartup(StartupEventArgs e)
1919

2020
//This is an alternate way to initialize MaterialDesignInXAML if you don't use the MaterialDesignResourceDictionary in App.xaml
2121
//Color primaryColor = SwatchHelper.Lookup[MaterialDesignColor.DeepPurple];
22-
//Color accentColor = SwatchHelper.Lookup[MaterialDesignColor.Lime];
23-
//ITheme theme = Theme.Create(new MaterialDesignLightTheme(), primaryColor, accentColor);
22+
//Color secondaryColor = SwatchHelper.Lookup[MaterialDesignColor.Lime];
23+
//ITheme theme = Theme.Create(new MaterialDesignLightTheme(), primaryColor, secondaryColor);
2424
//Resources.SetTheme(theme);
2525

2626

MaterialDesign3.Demo.Wpf/Buttons.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@
399399
Content="MID"
400400
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"
401401
Style="{StaticResource MaterialDesignFlatSecondaryMidBgButton}"
402-
ToolTip="MaterialDesignFlatAccentBackgroundButton" />
402+
ToolTip="MaterialDesignFlatSecondaryMidBgButton" />
403403
</smtx:XamlDisplay>
404404

405405
<smtx:XamlDisplay Margin="8,0" UniqueKey="buttons_flat_bg_6">
@@ -894,10 +894,10 @@
894894
<smtx:XamlDisplay Margin="8,0,0,5" UniqueKey="buttons_11">
895895
<materialDesign:PopupBox IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"
896896
PlacementMode="BottomAndAlignCentres"
897-
Style="{StaticResource MaterialDesignMultiFloatingActionAccentPopupBox}"
897+
Style="{StaticResource MaterialDesignMultiFloatingActionSecondaryPopupBox}"
898898
ToggleCheckedContentCommand="{Binding FloatingActionDemoCommand}"
899899
ToggleCheckedContentCommandParameter="wowsers"
900-
ToolTip="PopupBox, Style MaterialDesignMultiFloatingActionAccentPopupBox">
900+
ToolTip="PopupBox, Style MaterialDesignMultiFloatingActionSecondaryPopupBox">
901901
<materialDesign:PopupBox.ToggleCheckedContent>
902902
<materialDesign:PackIcon Width="24"
903903
Height="24"

0 commit comments

Comments
 (0)