Skip to content

Commit b05c439

Browse files
5.0.0!!!!!!!!! (#3230)
* Removing DrawerHostOpenMode.Model * Removing obsolete scrollbar styles * File scope namespace for MaterialDesignColors.Wpf * Rename all *Extensions to *Mixins * Removing obsolete ComboBox members * Removed ComboBoxPopupPlacement * Removing obsolete content templates * Remove MaterialDesignNavigatilRailTabControl * Removed RatingBarButton.IsWithinSelectedValue * Removed obsolete members from FlyoutAssist File scoped namespaces in MahApps project * Removed ShadowDepth * Fixing #3064 Do not freeze the converted drop shadow. Removed duplicated code * Fixing project swatch generation * Removed ShadowAssist.ShadowEdges * Removed PickerInnerPaddingConverter * Rename ShadowEdgeConverter Renamed to ShadowOpacityMaskConverter because that is where it is used. * Color work Updating tests to query obsolete brushes too WIP Theming tests to make sure all brushes exist * Version bumps * Adding script for updating brushes. Ran the script against MaterialDesignTheme.Wpf * Fixing color zone tests * More test fixes * More test fixes * Reverting demo app change * Renaming color converter classes to be *Extensions classes * Missed LabExtensions * Applied XAMLStyler format * Adding script for running XAML Styler * Removing un-used obsolete dictionaries Cleaned up generation of code * Update MaterialDesignThemes.UITests/TestBase.cs Co-authored-by: Nicolai Henriksen <[email protected]> * Renaming converter key * Renaming converter key * Fixing casing of properties * Replacing light/dark brushes with theme brushes Moved to theme brushes * Adding new MaterialDesign.Brush.CheckBox.UncheckedBorder brush * Adding new theme brush MaterialDesign.Brush.Chip.OutlineBorder * Adding MaterialDesign.Brush.DataGrid.ComboBoxHover brush * Adding MaterialDesign.Brush.DataGrid.PopupBorder Adding MaterialDesign.Brush.DataGrid.Border * Adding MaterialDesign.Brush.GridSplitter.PreviewBackground To handle the grid splitter. * Adding MaterialDesign.Brush.ListBoxItem.Border * Adding new ListView brushes * Adding toolbar brushes * Replacing textbox brushes * Adding tab control brush * Add ScrollBar brush * Radio button brushes * Cleaner expression bottom name * Adding comment indicating obsolete brushes will be removed * Fixing migration script * Updating brushes from powershell script. * Adding ComboBox disabled brush * Adding ListBoxItem selected * Adding RadioButton Border brush * Removing obsolete toggle button * Adding ToolBar Separator brush * Adding MaterialDesign.Brush.RadioButton.Disabled * Added MaterialDesign.Brush.ToggleButton.Switch.TrackOffBackground Removed obsolete style MaterialDesignSwitchAccentToggleButton * Adding combo box brushes * Adding MaterialDesign.Brush.ToggleButton.Background Adding MaterialDesign.Brush.ToggleButton.Foreground --------- Co-authored-by: Nicolai Henriksen <[email protected]>
1 parent 9b1a62e commit b05c439

File tree

266 files changed

+10800
-8052
lines changed

Some content is hidden

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

266 files changed

+10800
-8052
lines changed

.config/dotnet-tools.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"version": 1,
33
"isRoot": true,
44
"tools": {
5-
"paket": {
6-
"version": "7.2.1",
5+
"xamlstyler.console": {
6+
"version": "3.2206.4",
77
"commands": [
8-
"paket"
8+
"xstyler"
99
]
1010
}
1111
}
12-
}
12+
}

.github/workflows/get_versions.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
getting_versions:
2424
env:
2525
#Update these base version numbers
26-
mdix-version: "4.10.0"
27-
mdix-colors-version: "2.1.5"
28-
mdix-mahapps-version: "0.3.1"
26+
mdix-version: "5.0.0"
27+
mdix-colors-version: "3.0.0"
28+
mdix-mahapps-version: "1.0.0"
2929
name: Set version numbers
3030
runs-on: ubuntu-latest
3131
defaults:

Directory.Build.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<Project>
2-
3-
</Project>
2+
3+
</Project>

MahMaterialDragablzMashUp/PaletteSelectorViewModel.cs

Lines changed: 51 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,84 +2,83 @@
22
using MaterialDesignColors;
33
using MaterialDesignThemes.Wpf;
44

5-
namespace MahMaterialDragablzMashUp
5+
namespace MahMaterialDragablzMashUp;
6+
7+
public class PaletteSelectorViewModel : INotifyPropertyChanged
68
{
7-
public class PaletteSelectorViewModel : INotifyPropertyChanged
8-
{
9-
public event PropertyChangedEventHandler? PropertyChanged;
9+
public event PropertyChangedEventHandler? PropertyChanged;
1010

1111

12-
public PaletteSelectorViewModel()
13-
{
14-
Swatches = new SwatchesProvider().Swatches;
12+
public PaletteSelectorViewModel()
13+
{
14+
Swatches = new SwatchesProvider().Swatches;
1515

16-
PaletteHelper paletteHelper = new PaletteHelper();
17-
ITheme theme = paletteHelper.GetTheme();
16+
PaletteHelper paletteHelper = new PaletteHelper();
17+
Theme theme = paletteHelper.GetTheme();
1818

19-
IsDarkTheme = theme.GetBaseTheme() == BaseTheme.Dark;
20-
}
19+
IsDarkTheme = theme.GetBaseTheme() == BaseTheme.Dark;
20+
}
2121

22-
public ICommand ToggleStyleCommand { get; } = new AnotherCommandImplementation(o => ApplyStyle((bool)o!));
22+
public ICommand ToggleStyleCommand { get; } = new AnotherCommandImplementation(o => ApplyStyle((bool)o!));
2323

24-
public IEnumerable<Swatch> Swatches { get; }
24+
public IEnumerable<Swatch> Swatches { get; }
2525

26-
public ICommand ApplyPrimaryCommand { get; } = new AnotherCommandImplementation(o => ApplyPrimary((Swatch)o!));
26+
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 ApplyAccentCommand { get; } = new AnotherCommandImplementation(o => ApplyAccent((Swatch)o!));
2929

30-
private bool _isDarkTheme;
31-
public bool IsDarkTheme
30+
private bool _isDarkTheme;
31+
public bool IsDarkTheme
32+
{
33+
get => _isDarkTheme;
34+
set
3235
{
33-
get => _isDarkTheme;
34-
set
36+
if (_isDarkTheme != value)
3537
{
36-
if (_isDarkTheme != value)
37-
{
38-
_isDarkTheme = value;
39-
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsDarkTheme)));
40-
ApplyBase(value);
41-
}
38+
_isDarkTheme = value;
39+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsDarkTheme)));
40+
ApplyBase(value);
4241
}
4342
}
43+
}
4444

45-
private static void ApplyStyle(bool alternate)
45+
private static void ApplyStyle(bool alternate)
46+
{
47+
var resourceDictionary = new ResourceDictionary
4648
{
47-
var resourceDictionary = new ResourceDictionary
48-
{
49-
Source = new Uri(@"pack://application:,,,/Dragablz;component/Themes/materialdesign.xaml")
50-
};
49+
Source = new Uri(@"pack://application:,,,/Dragablz;component/Themes/materialdesign.xaml")
50+
};
5151

52-
var styleKey = alternate ? "MaterialDesignAlternateTabablzControlStyle" : "MaterialDesignTabablzControlStyle";
53-
var style = (Style)resourceDictionary[styleKey];
52+
var styleKey = alternate ? "MaterialDesignAlternateTabablzControlStyle" : "MaterialDesignTabablzControlStyle";
53+
var style = (Style)resourceDictionary[styleKey];
5454

55-
foreach (var tabablzControl in Dragablz.TabablzControl.GetLoadedInstances())
56-
{
57-
tabablzControl.Style = style;
58-
}
55+
foreach (var tabablzControl in Dragablz.TabablzControl.GetLoadedInstances())
56+
{
57+
tabablzControl.Style = style;
5958
}
59+
}
6060

61-
private static void ApplyBase(bool isDark)
62-
=> ModifyTheme(theme => theme.SetBaseTheme(isDark ? Theme.Dark : Theme.Light));
61+
private static void ApplyBase(bool isDark)
62+
=> ModifyTheme(theme => theme.SetBaseTheme(isDark ? BaseTheme.Dark : BaseTheme.Light));
6363

64-
private static void ApplyPrimary(Swatch swatch)
65-
=> ModifyTheme(theme => theme.SetPrimaryColor(swatch.ExemplarHue.Color));
64+
private static void ApplyPrimary(Swatch swatch)
65+
=> ModifyTheme(theme => theme.SetPrimaryColor(swatch.ExemplarHue.Color));
6666

67-
private static void ApplyAccent(Swatch swatch)
67+
private static void ApplyAccent(Swatch swatch)
68+
{
69+
if (swatch.AccentExemplarHue is Hue accentHue)
6870
{
69-
if (swatch.AccentExemplarHue is Hue accentHue)
70-
{
71-
ModifyTheme(theme => theme.SetSecondaryColor(accentHue.Color));
72-
}
71+
ModifyTheme(theme => theme.SetSecondaryColor(accentHue.Color));
7372
}
73+
}
7474

75-
private static void ModifyTheme(Action<ITheme> modificationAction)
76-
{
77-
PaletteHelper paletteHelper = new PaletteHelper();
78-
ITheme theme = paletteHelper.GetTheme();
75+
private static void ModifyTheme(Action<Theme> modificationAction)
76+
{
77+
PaletteHelper paletteHelper = new PaletteHelper();
78+
Theme theme = paletteHelper.GetTheme();
7979

80-
modificationAction?.Invoke(theme);
80+
modificationAction?.Invoke(theme);
8181

82-
paletteHelper.SetTheme(theme);
83-
}
82+
paletteHelper.SetTheme(theme);
8483
}
8584
}

MainDemo.Wpf/App.xaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,17 @@
2020
<!-- If you would prefer to use your own colors there is an option for that as well -->
2121
<!--<materialDesign:CustomColorTheme BaseTheme="Light" PrimaryColor="Aqua" SecondaryColor="DarkGreen" />-->
2222

23-
<!-- You can also use the built in theme dictionaries as well
24-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
25-
<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" />
23+
<!-- You can also use the built in theme dictionaries as well -->
24+
<!--
25+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
26+
<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" />
2728
-->
2829

30+
31+
<!-- NB: For anyone migrating and not wanting to update your brushes you will want this resource dictionary for old brush names -->
32+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ObsoleteBrushes.xaml" />
33+
2934
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
3035

3136
<ResourceDictionary Source="pack://application:,,,/ShowMeTheXAML.AvalonEdit;component/Themes/xamldisplayer.xaml" />

MainDemo.Wpf/Buttons.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,8 @@
950950
<StackPanel Grid.Row="13" Orientation="Horizontal">
951951
<smtx:XamlDisplay Margin="0,0,20,0" UniqueKey="button_duration_1">
952952
<Button materialDesign:ShadowAssist.ShadowAnimationDuration="0:0:0"
953-
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
954-
Content="Instant Duration" />
953+
Content="Instant Duration"
954+
Style="{StaticResource MaterialDesignRaisedSecondaryButton}" />
955955
</smtx:XamlDisplay>
956956
<smtx:XamlDisplay Margin="0,0,20,0" UniqueKey="button_duration_2">
957957
<Button>

MainDemo.Wpf/Chips.xaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,7 @@
329329

330330
<materialDesign:Card Margin="4">
331331
<smtx:XamlDisplay Margin="0,0,6,4" UniqueKey="chips_30">
332-
<ListBox x:Name="RadioButtonGroupChoiceChipSecondary"
333-
Style="{StaticResource MaterialDesignChoiceChipSecondaryListBox}">
332+
<ListBox x:Name="RadioButtonGroupChoiceChipSecondary" Style="{StaticResource MaterialDesignChoiceChipSecondaryListBox}">
334333
<ListBoxItem Content="Mercury" />
335334
<ListBoxItem Content="Venus" IsSelected="True" />
336335
<ListBoxItem Content="Earth" />
@@ -365,8 +364,7 @@
365364

366365
<materialDesign:Card Margin="4">
367366
<smtx:XamlDisplay Margin="0,0,6,4" UniqueKey="chips_33">
368-
<ListBox x:Name="RadioButtonGroupChoiceChipSecondaryOutline"
369-
Style="{StaticResource MaterialDesignChoiceChipSecondaryOutlineListBox}">
367+
<ListBox x:Name="RadioButtonGroupChoiceChipSecondaryOutline" Style="{StaticResource MaterialDesignChoiceChipSecondaryOutlineListBox}">
370368
<ListBoxItem Content="Mercury" />
371369
<ListBoxItem Content="Venus" IsSelected="True" />
372370
<ListBoxItem Content="Earth" />

MainDemo.Wpf/ColorTool.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@
137137
<Setter Property="materialDesign:ElevationAssist.Elevation" Value="Dp0" />
138138
<Setter Property="materialDesign:RippleAssist.Feedback" Value="LightGray" />
139139
<Setter Property="materialDesign:RippleAssist.RippleOnTop" Value="True" />
140-
<Setter Property="materialDesign:ShadowAssist.ShadowEdges" Value="All" />
141140
</Style>
142141
</Grid.Resources>
143142

0 commit comments

Comments
 (0)