Skip to content

Commit 0769988

Browse files
authored
Merge pull request #92 from MaterialDesignInXAML/master
Update
2 parents e9de09b + bde4374 commit 0769988

19 files changed

+310
-22
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
defaults:
15+
run:
16+
shell: pwsh
17+
18+
jobs:
19+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
20+
copilot-setup-steps:
21+
runs-on: windows-latest
22+
23+
permissions:
24+
contents: read
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v6
29+
30+
- name: Setup .NET
31+
uses: actions/setup-dotnet@v5
32+
with:
33+
dotnet-version: |
34+
8.x
35+
9.x
36+
10.x
37+
38+
- name: Restore dependencies
39+
run: dotnet restore MaterialDesignToolkit.Full.slnx

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ jobs:
275275
steps:
276276
# Checkout is needed so that we can update the get_versions.yml file
277277
- uses: actions/checkout@v6
278+
with:
279+
token: ${{ secrets.SA_PAT }}
278280

279281
- name: Increment Version Numbers
280282
run: |

src/MainDemo.Wpf/Domain/MainWindowViewModel.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,14 @@ private static IEnumerable<DemoItem> GenerateDemoItems(ISnackbarMessageQueue sna
344344
DocumentationLink.StyleLink("ToolBar")
345345
]);
346346

347+
yield return new DemoItem(
348+
"StatusBar",
349+
typeof(StatusBars),
350+
[
351+
DocumentationLink.DemoPageLink<StatusBars>(),
352+
DocumentationLink.StyleLink("StatusBar")
353+
]);
354+
347355
yield return new DemoItem(
348356
"Progress Indicator",
349357
typeof(Progress),

src/MainDemo.Wpf/StatusBars.xaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<UserControl x:Class="MaterialDesignDemo.StatusBars"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:smtx="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML"
8+
d:DesignHeight="600"
9+
d:DesignWidth="800"
10+
mc:Ignorable="d">
11+
<StackPanel>
12+
<TextBlock Style="{StaticResource PageTitleTextBlock}" Text="StatusBar" />
13+
<TextBlock Style="{StaticResource PageSectionTitleTextBlock}" Text="Default StatusBar" />
14+
15+
<smtx:XamlDisplay HorizontalAlignment="Left" UniqueKey="statusbar_1">
16+
<StatusBar>
17+
<StatusBarItem Content="Ready" />
18+
<Separator />
19+
<StatusBarItem Content="Items: 42" />
20+
<Separator />
21+
<StatusBarItem Content="100%" />
22+
</StatusBar>
23+
</smtx:XamlDisplay>
24+
25+
<TextBlock Margin="0,16,0,0"
26+
Style="{StaticResource PageSectionTitleTextBlock}"
27+
Text="StatusBar with icons" />
28+
29+
<smtx:XamlDisplay HorizontalAlignment="Left" UniqueKey="statusbar_2">
30+
<StatusBar>
31+
<StatusBarItem>
32+
<StackPanel Orientation="Horizontal" Height="40">
33+
<materialDesign:PackIcon Kind="CheckCircle"
34+
Foreground="Lime"
35+
VerticalAlignment="Center"
36+
Margin="0,0,4,0" />
37+
<TextBlock Text="Build succeeded" VerticalAlignment="Center" />
38+
</StackPanel>
39+
</StatusBarItem>
40+
<Separator />
41+
<StatusBarItem>
42+
<StackPanel Orientation="Horizontal">
43+
<materialDesign:PackIcon Kind="SourceBranch"
44+
VerticalAlignment="Center"
45+
Margin="0,0,4,0" />
46+
<TextBlock Text="main" VerticalAlignment="Center" />
47+
</StackPanel>
48+
</StatusBarItem>
49+
<Separator />
50+
<StatusBarItem>
51+
<StackPanel Orientation="Horizontal">
52+
<materialDesign:PackIcon Kind="AlertCircleOutline"
53+
VerticalAlignment="Center"
54+
Margin="0,0,4,0"
55+
Foreground="Red"/>
56+
<TextBlock Text="0 Errors" VerticalAlignment="Center" />
57+
</StackPanel>
58+
</StatusBarItem>
59+
<Separator />
60+
<StatusBarItem>
61+
<StackPanel Orientation="Horizontal">
62+
<materialDesign:PackIcon Kind="Alert"
63+
VerticalAlignment="Center"
64+
Margin="0,0,4,0"
65+
Foreground="Orange"/>
66+
<TextBlock Text="2 Warnings" VerticalAlignment="Center" />
67+
</StackPanel>
68+
</StatusBarItem>
69+
</StatusBar>
70+
</smtx:XamlDisplay>
71+
72+
<TextBlock Margin="0,16,0,0"
73+
Style="{StaticResource PageSectionTitleTextBlock}"
74+
Text="StatusBar with ProgressBar" />
75+
76+
<smtx:XamlDisplay HorizontalAlignment="Left" UniqueKey="statusbar_3">
77+
<StatusBar>
78+
<StatusBarItem Content="Processing..." />
79+
<Separator />
80+
<StatusBarItem HorizontalContentAlignment="Stretch">
81+
<ProgressBar Width="120"
82+
Height="8"
83+
Value="65" />
84+
</StatusBarItem>
85+
<Separator />
86+
<StatusBarItem Content="65%" />
87+
</StatusBar>
88+
</smtx:XamlDisplay>
89+
</StackPanel>
90+
</UserControl>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace MaterialDesignDemo;
2+
3+
public partial class StatusBars
4+
{
5+
public StatusBars() => InitializeComponent();
6+
}

src/MaterialDesignThemes.Wpf/ResourceDictionaryExtensions.g.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ private static partial void LoadThemeColors(ResourceDictionary resourceDictionar
8484
theme.ScrollBars.Foreground = GetColor(resourceDictionary, "MaterialDesign.Brush.ScrollBar.Foreground");
8585
theme.ScrollBars.RepeatButtonBackground = GetColor(resourceDictionary, "MaterialDesign.Brush.ScrollBar.RepeatButtonBackground");
8686
theme.Separators.Background = GetColor(resourceDictionary, "MaterialDesign.Brush.Separator.Background");
87+
theme.StatusBars.Background = GetColor(resourceDictionary, "MaterialDesign.Brush.StatusBar.Background");
88+
theme.StatusBars.Foreground = GetColor(resourceDictionary, "MaterialDesign.Brush.StatusBar.Foreground");
8789
theme.TabControls.Divider = GetColor(resourceDictionary, "MaterialDesign.Brush.TabControl.Divider");
8890
theme.ToolBars.Background = GetColor(resourceDictionary, "MaterialDesign.Brush.ToolBar.Background", "MaterialDesignToolBarBackground");
8991
theme.ToolBars.Separator = GetColor(resourceDictionary, "MaterialDesign.Brush.ToolBar.Separator");
@@ -227,6 +229,8 @@ private static partial void ApplyThemeColors(ResourceDictionary resourceDictiona
227229
SetSolidColorBrush(resourceDictionary, "MaterialDesign.Brush.ScrollBar.Foreground", theme.ScrollBars.Foreground);
228230
SetSolidColorBrush(resourceDictionary, "MaterialDesign.Brush.ScrollBar.RepeatButtonBackground", theme.ScrollBars.RepeatButtonBackground);
229231
SetSolidColorBrush(resourceDictionary, "MaterialDesign.Brush.Separator.Background", theme.Separators.Background);
232+
SetSolidColorBrush(resourceDictionary, "MaterialDesign.Brush.StatusBar.Background", theme.StatusBars.Background);
233+
SetSolidColorBrush(resourceDictionary, "MaterialDesign.Brush.StatusBar.Foreground", theme.StatusBars.Foreground);
230234
SetSolidColorBrush(resourceDictionary, "MaterialDesign.Brush.TabControl.Divider", theme.TabControls.Divider);
231235
SetSolidColorBrush(resourceDictionary, "MaterialDesign.Brush.ToolBar.Background", theme.ToolBars.Background);
232236
SetSolidColorBrush(resourceDictionary, "MaterialDesignToolBarBackground", theme.ToolBars.Background);

src/MaterialDesignThemes.Wpf/Snackbar.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,13 @@ public SnackbarActionButtonPlacementMode ActionButtonPlacement
189189
}
190190

191191
public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register(
192-
nameof(CornerRadius), typeof(Thickness), typeof(Snackbar), new PropertyMetadata(new Thickness(0)));
192+
nameof(CornerRadius), typeof(CornerRadius), typeof(Snackbar), new PropertyMetadata(new CornerRadius(3)));
193193

194194
[Bindable(true)]
195195
[Category("Appearance")]
196-
public Thickness CornerRadius
196+
public CornerRadius CornerRadius
197197
{
198-
get => (Thickness)GetValue(CornerRadiusProperty);
198+
get => (CornerRadius)GetValue(CornerRadiusProperty);
199199
set => SetValue(CornerRadiusProperty, value);
200200
}
201201
}

src/MaterialDesignThemes.Wpf/Theme.g.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public Theme()
2929
RadioButtons = new(this);
3030
ScrollBars = new(this);
3131
Separators = new(this);
32+
StatusBars = new(this);
3233
TabControls = new(this);
3334
ToolBars = new(this);
3435
ToggleButtons = new(this);
@@ -99,6 +100,8 @@ public ColorReference ValidationError
99100

100101
public Separator Separators { get; set; }
101102

103+
public StatusBar StatusBars { get; set; }
104+
102105
public TabControl TabControls { get; set; }
103106

104107
public ToolBar ToolBars { get; set; }
@@ -803,6 +806,30 @@ public ColorReference Background
803806

804807
}
805808

809+
public class StatusBar
810+
{
811+
private readonly Theme _theme;
812+
public StatusBar(Theme theme)
813+
{
814+
_theme = theme ?? throw new ArgumentNullException(nameof(theme));
815+
}
816+
817+
private ColorReference _background;
818+
public ColorReference Background
819+
{
820+
get => _theme.Resolve(_background);
821+
set => _background = value;
822+
}
823+
824+
private ColorReference _foreground;
825+
public ColorReference Foreground
826+
{
827+
get => _theme.Resolve(_foreground);
828+
set => _foreground = value;
829+
}
830+
831+
}
832+
806833
public class TabControl
807834
{
808835
private readonly Theme _theme;

src/MaterialDesignThemes.Wpf/ThemeExtensions.g.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ public static partial void SetLightTheme(this Theme theme)
8989
theme.ScrollBars.Foreground = BaseThemeColors.Neutral800;
9090
theme.ScrollBars.RepeatButtonBackground = BaseThemeColors.Neutral800;
9191
theme.Separators.Background = BaseThemeColors.Neutral800;
92+
theme.StatusBars.Background = BaseThemeColors.Neutral900;
93+
theme.StatusBars.Foreground = BaseThemeColors.Black900;
9294
theme.TabControls.Divider = BaseThemeColors.Black100;
9395
theme.ToolBars.Background = BaseThemeColors.Neutral900;
9496
theme.ToolBars.Separator = BaseThemeColors.Black100;
@@ -178,6 +180,8 @@ public static partial void SetDarkTheme(this Theme theme)
178180
theme.ScrollBars.Foreground = BaseThemeColors.Neutral400;
179181
theme.ScrollBars.RepeatButtonBackground = BaseThemeColors.Neutral400;
180182
theme.Separators.Background = BaseThemeColors.Neutral400;
183+
theme.StatusBars.Background = BaseThemeColors.Neutral50;
184+
theme.StatusBars.Foreground = BaseThemeColors.White900;
181185
theme.TabControls.Divider = BaseThemeColors.White100;
182186
theme.ToolBars.Background = BaseThemeColors.Neutral50;
183187
theme.ToolBars.Separator = BaseThemeColors.White100;

src/MaterialDesignThemes.Wpf/Themes/MaterialDesign2.Defaults.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.RichTextBox.xaml" />
3131
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ScrollBar.xaml" />
3232
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ScrollViewer.xaml" />
33+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Separator.xaml" />
3334
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
3435
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Slider.xaml" />
36+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.StatusBar.xaml" />
3537
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TabControl.xaml" />
3638
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBox.xaml" />
3739
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
@@ -81,6 +83,8 @@
8183
<Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource MaterialDesignScrollBar}" />
8284
<Style TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource MaterialDesignScrollViewer}" />
8385
<Style TargetType="{x:Type Slider}" BasedOn="{StaticResource MaterialDesignSlider}" />
86+
<Style TargetType="{x:Type StatusBar}" BasedOn="{StaticResource MaterialDesignStatusBar}" />
87+
<Style TargetType="{x:Type StatusBarItem}" BasedOn="{StaticResource MaterialDesignStatusBarItem}" />
8488
<Style TargetType="{x:Type TabControl}" BasedOn="{StaticResource MaterialDesignTabControl}" />
8589
<Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource MaterialDesignTabItem}" />
8690
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignTextBox}" />

0 commit comments

Comments
 (0)