Skip to content

Commit

Permalink
Merge pull request #53 from MaterialDesignInXAML/master
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
adrbarros authored Jan 13, 2025
2 parents 452da86 + 0ff7d5d commit c87c20d
Show file tree
Hide file tree
Showing 20 changed files with 506 additions and 137 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/get_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
getting_versions:
env:
#Update these base version numbers
mdix-version: "5.2.1"
mdix-colors-version: "5.2.1"
mdix-mahapps-version: "5.2.1"
mdix-version: "5.2.2"
mdix-colors-version: "5.2.2"
mdix-mahapps-version: "5.2.2"
name: Set version numbers
runs-on: ubuntu-latest
defaults:
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ on:

env:
solution: MaterialDesignToolkit.Full.sln
# Needed for GitHub CLI
GITHUB_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.SA_PAT }}

defaults:
run:
shell: pwsh

# Needed for updating the version numbers at the end of the pipeline
permissions:
id-token: write
contents: write

jobs:
get_versions:
Expand Down Expand Up @@ -277,9 +272,6 @@ jobs:
name: Update Version Numbers
environment: production

permissions:
actions: write

steps:
# Checkout is needed so that we can update the get_versions.yml file
- uses: actions/checkout@v4
Expand Down Expand Up @@ -313,8 +305,6 @@ jobs:
Update-Version -Prefix "mdix-mahapps-version"
- name: Open Pull Request
env:
GITHUB_TOKEN: ${{ secrets.SA_PAT }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
Expand Down
17 changes: 17 additions & 0 deletions src/MainDemo.Wpf/FieldsLineUp.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
<CheckBox x:Name="IsEnabledCheckBox"
Content="IsEnabled"
IsChecked="True" />
<CheckBox x:Name="IsReadOnlyCheckBox" Content="TextBox.IsReadOnly" />
<CheckBox x:Name="HasClearButtonCheckBox" Content="TextFieldAssist.HasClearButton" />
<CheckBox x:Name="IsEditableCheckBox" Content="ComboBox.IsEditable" />
</StackPanel>
Expand Down Expand Up @@ -159,6 +160,7 @@
<ColumnDefinition MinWidth="100" />
<ColumnDefinition MinWidth="100" />
<ColumnDefinition MinWidth="100" />
<ColumnDefinition MinWidth="100" />
</Grid.ColumnDefinitions>

<TextBlock Grid.Row="1"
Expand Down Expand Up @@ -202,6 +204,10 @@
Grid.Column="6"
Style="{StaticResource FieldHeader}"
Text="NumericUpDown" />
<TextBlock Grid.Row="0"
Grid.Column="7"
Style="{StaticResource FieldHeader}"
Text="AutoSuggestBox " />

<TextBox Grid.Row="1" Grid.Column="1" />
<TextBox Grid.Row="2"
Expand Down Expand Up @@ -269,6 +275,17 @@
Grid.Column="6"
Style="{StaticResource MaterialDesignOutlinedNumericUpDown}" />

<materialDesign:AutoSuggestBox Grid.Row="1" Grid.Column="7" />
<materialDesign:AutoSuggestBox Grid.Row="2"
Grid.Column="7"
Style="{StaticResource MaterialDesignFloatingHintAutoSuggestBox}" />
<materialDesign:AutoSuggestBox Grid.Row="3"
Grid.Column="7"
Style="{StaticResource MaterialDesignFilledAutoSuggestBox}" />
<materialDesign:AutoSuggestBox Grid.Row="4"
Grid.Column="7"
Style="{StaticResource MaterialDesignOutlinedAutoSuggestBox}" />

</Grid>
</StackPanel>
</GroupBox>
Expand Down
5 changes: 5 additions & 0 deletions src/MainDemo.Wpf/FieldsLineUp.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public FieldsLineUp()
control.Margin = new Thickness(2, 10, 2, 10);
if (control is ComboBox comboBox)
comboBox.SetBinding(ComboBox.IsEditableProperty, new Binding(nameof(CheckBox.IsChecked)) { ElementName = nameof(IsEditableCheckBox) });
if (control is TextBoxBase tb)
tb.SetBinding(TextBoxBase.IsReadOnlyProperty, new Binding(nameof(CheckBox.IsChecked)) { ElementName = nameof(IsReadOnlyCheckBox) });
SetValue(control);
}
}
Expand All @@ -73,6 +75,9 @@ private static void SetValue(Control control)
{
switch (control)
{
case MaterialDesignThemes.Wpf.AutoSuggestBox autoSuggestBox:
autoSuggestBox.Text = nameof(MaterialDesignThemes.Wpf.AutoSuggestBox.Text);
break;
case TextBox textBox:
textBox.Text = nameof(TextBox.Text);
break;
Expand Down
70 changes: 69 additions & 1 deletion src/MainDemo.Wpf/MenusAndToolBars.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<UserControl x:Class="MaterialDesignDemo.MenusAndToolBars"
<UserControl x:Class="MaterialDesignDemo.MenusAndToolBars"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Expand Down Expand Up @@ -62,6 +62,59 @@
</Menu>
</smtx:XamlDisplay>

<Rectangle Style="{StaticResource PageSectionSeparator}" />
<TextBlock Style="{StaticResource PageSectionTitleTextBlock}" Text="Menu with custom item margin" />

<smtx:XamlDisplay HorizontalAlignment="Left" UniqueKey="menus_1_1">
<Menu materialDesign:MenuAssist.MenuItemsPresenterMargin="0">
<MenuItem Header="_File">
<!--
You can set the highlighted color with:
materialDesign:MenuItemAssist.HighlightedBackground="Fuchsia"
-->
<MenuItem Header="Save" Icon="{materialDesign:PackIcon Kind=ContentSave}" />

<MenuItem Header="Save As.." />

<MenuItem Header="Exit"
Icon="{materialDesign:PackIcon Kind=ExitToApp}"
InputGestureText="Ctrl+E" />

<Separator />

<MenuItem Header="Excellent"
IsCheckable="True"
IsChecked="True" />

<MenuItem Header="Rubbish" IsCheckable="True" />

<MenuItem Header="Dig Deeper" InputGestureText="Ctrl+D">
<MenuItem Header="Enlightenment?" IsCheckable="True" />
<MenuItem Header="Disappointment" IsCheckable="True" />
</MenuItem>

<MenuItem Header="Look Deeper" InputGestureText="Ctrl+D">
<MenuItem Header="Plain" />
<MenuItem Header="Ice Cream" />
</MenuItem>
</MenuItem>

<MenuItem Header="_Edit">
<MenuItem Command="Cut"
Header="_Cut"
Icon="{materialDesign:PackIcon Kind=ContentCut}" />

<MenuItem Command="Copy"
Header="_Copy"
Icon="{materialDesign:PackIcon Kind=ContentCopy}" />

<MenuItem Command="Paste"
Header="_Paste"
Icon="{materialDesign:PackIcon Kind=ContentPaste}" />
</MenuItem>
</Menu>
</smtx:XamlDisplay>

<Rectangle Style="{StaticResource PageSectionSeparator}" />
<TextBlock Style="{StaticResource PageSectionTitleTextBlock}" Text="Menu with custom Height" />

Expand Down Expand Up @@ -345,6 +398,21 @@
</TextBox.ContextMenu>
</TextBox>
</smtx:XamlDisplay>

<smtx:XamlDisplay UniqueKey="menus_6" Margin="0,0,16,16">
<TextBox Text="With Custom Item Margin">
<TextBox.ContextMenu>
<ContextMenu materialDesign:MenuAssist.MenuItemsPresenterMargin="0">
<MenuItem Header="Hello World" />
<MenuItem Header="Clickety Click">
<MenuItem Header="Clackety Clack 1" />
<MenuItem Header="Clackety Clack 2" />
<MenuItem Header="Clackety Clack 3" />
</MenuItem>
</ContextMenu>
</TextBox.ContextMenu>
</TextBox>
</smtx:XamlDisplay>
</WrapPanel>
</StackPanel>
</UserControl>
Expand Down
15 changes: 15 additions & 0 deletions src/MaterialDesign3.Demo.Wpf/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,21 @@
<Setter Property="VerticalContentAlignment" Value="Bottom" />
<Setter Property="materialDesignDemo:XamlDisplayEx.ButtonDock" Value="Right" />
</Style>

<Style TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignHeadline5TextBlock}" x:Key="PageTitleTextBlock">
<Setter Property="Margin" Value="0 0 0 24"/>
</Style>

<Style TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignHeadline6TextBlock}" x:Key="PageSectionTitleTextBlock">
<Setter Property="Margin" Value="0 0 0 16"/>
</Style>

<Style TargetType="Rectangle" x:Key="PageSectionSeparator">
<Setter Property="Margin" Value="0,24" />
<Setter Property="Height" Value="1" />
<Setter Property="Fill" Value="{DynamicResource MaterialDesignDivider}" />
</Style>

</ResourceDictionary>
</Application.Resources>
</Application>
Expand Down
17 changes: 17 additions & 0 deletions src/MaterialDesign3.Demo.Wpf/FieldsLineUp.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<CheckBox x:Name="IsEnabledCheckBox"
Content="IsEnabled"
IsChecked="True" />
<CheckBox x:Name="IsReadOnlyCheckBox" Content="TextBox.IsReadOnly" />
<CheckBox x:Name="HasClearButtonCheckBox" Content="TextFieldAssist.HasClearButton" />
<CheckBox x:Name="IsEditableCheckBox" Content="ComboBox.IsEditable" />
</StackPanel>
Expand Down Expand Up @@ -148,6 +149,7 @@
<ColumnDefinition MinWidth="100" />
<ColumnDefinition MinWidth="100" />
<ColumnDefinition MinWidth="100" />
<ColumnDefinition MinWidth="100" />
</Grid.ColumnDefinitions>

<TextBlock Grid.Row="1"
Expand Down Expand Up @@ -191,6 +193,10 @@
Grid.Column="6"
Style="{StaticResource FieldHeader}"
Text="NumericUpDown" />
<TextBlock Grid.Row="0"
Grid.Column="7"
Style="{StaticResource FieldHeader}"
Text="AutoSuggestBox " />

<TextBox Grid.Row="1" Grid.Column="1" />
<TextBox Grid.Row="2"
Expand Down Expand Up @@ -258,6 +264,17 @@
Grid.Column="6"
Style="{StaticResource MaterialDesignOutlinedNumericUpDown}" />

<materialDesign:AutoSuggestBox Grid.Row="1" Grid.Column="7" />
<materialDesign:AutoSuggestBox Grid.Row="2"
Grid.Column="7"
Style="{StaticResource MaterialDesignFloatingHintAutoSuggestBox}" />
<materialDesign:AutoSuggestBox Grid.Row="3"
Grid.Column="7"
Style="{StaticResource MaterialDesignFilledAutoSuggestBox}" />
<materialDesign:AutoSuggestBox Grid.Row="4"
Grid.Column="7"
Style="{StaticResource MaterialDesignOutlinedAutoSuggestBox}" />

</Grid>
</StackPanel>
</GroupBox>
Expand Down
5 changes: 5 additions & 0 deletions src/MaterialDesign3.Demo.Wpf/FieldsLineUp.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public FieldsLineUp()
control.Margin = new Thickness(2, 10, 2, 10);
if (control is ComboBox comboBox)
comboBox.SetBinding(ComboBox.IsEditableProperty, new Binding(nameof(CheckBox.IsChecked)) { ElementName = nameof(IsEditableCheckBox) });
if (control is TextBoxBase tb)
tb.SetBinding(TextBoxBase.IsReadOnlyProperty, new Binding(nameof(CheckBox.IsChecked)) { ElementName = nameof(IsReadOnlyCheckBox) });
SetValue(control);
}
}
Expand All @@ -73,6 +75,9 @@ private static void SetValue(Control control)
{
switch (control)
{
case MaterialDesignThemes.Wpf.AutoSuggestBox autoSuggestBox:
autoSuggestBox.Text = nameof(MaterialDesignThemes.Wpf.AutoSuggestBox.Text);
break;
case TextBox textBox:
textBox.Text = nameof(TextBox.Text);
break;
Expand Down
Loading

0 comments on commit c87c20d

Please sign in to comment.