-
Notifications
You must be signed in to change notification settings - Fork 3.5k
NavigationRail, NavigationBar, NavigationDrawer controls for MaterialDesign3 #2628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
c6fd7e1
15fe77b
36fa8d4
1ce20e2
24fcd3f
289e990
06b0a84
76a6e5c
029db6b
76c528c
98f234b
9414d8d
9c9babe
56f742e
ed21dee
9e8e6fe
bd3a881
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| using MaterialDesignThemes.Wpf; | ||
|
|
||
| namespace MaterialDesign3Demo.Domain; | ||
|
|
||
| public class SampleItem | ||
| { | ||
| public string Title { get; set; } | ||
| public PackIconKind SelectedIcon { get; set; } | ||
| public PackIconKind UnselectedIcon { get; set; } | ||
| } | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,199 @@ | ||
| <UserControl x:Class="MaterialDesign3Demo.NavigationBar" | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| xmlns:smtx="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML" | ||
| xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" | ||
| xmlns:local="clr-namespace:MaterialDesign3Demo" | ||
| xmlns:domain="clr-namespace:MaterialDesign3Demo.Domain" | ||
| mc:Ignorable="d" | ||
| d:DesignHeight="450" d:DesignWidth="800"> | ||
| <Grid> | ||
| <StackPanel> | ||
|
|
||
| <StackPanel> | ||
| <TextBlock Text="Normal"/> | ||
|
|
||
| <Button Height="56" Width="56" | ||
| Background="{DynamicResource SecondaryHueMidBrush}" | ||
| Foreground="{DynamicResource SecondaryHueMidBrushForeground}" | ||
| BorderThickness="0" | ||
| HorizontalAlignment="Right" | ||
| VerticalAlignment="Bottom" | ||
| materialDesign:ButtonAssist.CornerRadius="16" | ||
| Margin="16"> | ||
| <materialDesign:PackIcon Kind="PencilOutline" | ||
| Width="24" | ||
| Height="24"/> | ||
| </Button> | ||
|
|
||
| <Grid Height="80" | ||
| Background="{DynamicResource MaterialDesignCardBackground}"> | ||
| <ListBox Height="80" | ||
|
||
| SelectedIndex="0" | ||
| Style="{StaticResource MaterialDesign3NavigationBarPrimaryListBox}"> | ||
| <ListBoxItem> | ||
| <ListBoxItem.Style> | ||
| <Style TargetType="ListBoxItem" BasedOn="{StaticResource MaterialDesign3NavigationBarPrimaryListBoxItem}"> | ||
| <Setter Property="materialDesign:NavigationBarAssist.SelectedIcon" Value="Circle"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.UnselectedIcon" Value="CircleOutline"/> | ||
| </Style> | ||
| </ListBoxItem.Style> | ||
| <TextBlock Text="text 1"/> | ||
| </ListBoxItem> | ||
| <ListBoxItem > | ||
| <ListBoxItem.Style> | ||
| <Style TargetType="ListBoxItem" BasedOn="{StaticResource MaterialDesign3NavigationBarPrimaryListBoxItem}"> | ||
| <Setter Property="materialDesign:NavigationBarAssist.SelectedIcon" Value="Triangle"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.UnselectedIcon" Value="TriangleOutline"/> | ||
| </Style> | ||
| </ListBoxItem.Style> | ||
| <TextBlock Text="text 2"/> | ||
| </ListBoxItem> | ||
| <ListBoxItem > | ||
| <ListBoxItem.Style> | ||
| <Style TargetType="ListBoxItem" BasedOn="{StaticResource MaterialDesign3NavigationBarPrimaryListBoxItem}"> | ||
| <Setter Property="materialDesign:NavigationBarAssist.SelectedIcon" Value="Receipt"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.UnselectedIcon" Value="ReceiptOutline"/> | ||
| </Style> | ||
| </ListBoxItem.Style> | ||
| <TextBlock Text="text 3"/> | ||
| </ListBoxItem> | ||
| </ListBox> | ||
| </Grid> | ||
| </StackPanel> | ||
|
|
||
| <StackPanel Margin="0 20 0 0"> | ||
| <TextBlock Text="MVVM"/> | ||
|
|
||
| <Grid Height="80" | ||
| Background="{DynamicResource MaterialDesignCardBackground}"> | ||
| <ListBox Height="80" | ||
| ItemsSource="{Binding SampleList}" | ||
| SelectedIndex="0" | ||
| Style="{StaticResource MaterialDesign3NavigationBarListBox}"> | ||
| <ListBox.ItemContainerStyle> | ||
| <Style TargetType="ListBoxItem" BasedOn="{StaticResource MaterialDesign3NavigationBarListBoxItem}"> | ||
| <Setter Property="materialDesign:NavigationBarAssist.SelectedIcon" Value="{Binding SelectedIcon}"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.UnselectedIcon" Value="{Binding UnselectedIcon}"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.IsTextVisible" Value="True"/> | ||
| </Style> | ||
| </ListBox.ItemContainerStyle> | ||
| <ListBox.Resources> | ||
| <DataTemplate DataType="{x:Type domain:SampleItem}"> | ||
| <TextBlock Text="{Binding Title}"/> | ||
| </DataTemplate> | ||
| </ListBox.Resources> | ||
| </ListBox> | ||
| </Grid> | ||
| </StackPanel> | ||
|
|
||
| <StackPanel Margin="0 20 0 0"> | ||
| <TextBlock Text="Without Text"/> | ||
|
|
||
| <Grid Height="80" | ||
| Background="{DynamicResource MaterialDesignCardBackground}"> | ||
| <ListBox Height="80" | ||
| ItemsSource="{Binding SampleList}" | ||
| SelectedIndex="0" | ||
| Style="{StaticResource MaterialDesign3NavigationBarPrimaryListBox}"> | ||
| <ListBox.ItemContainerStyle> | ||
| <Style TargetType="ListBoxItem" BasedOn="{StaticResource MaterialDesign3NavigationBarPrimaryListBoxItem}"> | ||
| <Setter Property="materialDesign:NavigationBarAssist.SelectedIcon" Value="{Binding SelectedIcon}"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.UnselectedIcon" Value="{Binding UnselectedIcon}"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.IsTextVisible" Value="False"/> | ||
| </Style> | ||
| </ListBox.ItemContainerStyle> | ||
| <ListBox.Resources> | ||
| <DataTemplate DataType="{x:Type domain:SampleItem}"> | ||
| <TextBlock Text="{Binding Title}"/> | ||
| </DataTemplate> | ||
| </ListBox.Resources> | ||
| </ListBox> | ||
| </Grid> | ||
| </StackPanel> | ||
|
|
||
|
|
||
| <StackPanel Margin="0 20 0 0"> | ||
| <TextBlock Text="Custom Color"/> | ||
|
|
||
| <Button Height="56" | ||
| Width="56" | ||
| Background="#633B48" | ||
| Foreground="#FFD8E4" | ||
| BorderThickness="0" | ||
| HorizontalAlignment="Right" | ||
| VerticalAlignment="Bottom" | ||
| materialDesign:ButtonAssist.CornerRadius="16" | ||
| Margin="16"> | ||
| <materialDesign:PackIcon Kind="PencilOutline" Width="24" Height="24"/> | ||
| </Button> | ||
|
|
||
| <Grid Height="80" Background="#25232A"> | ||
| <ListBox Height="80" ItemsSource="{Binding SampleList}" SelectedIndex="0" Foreground="#E8DEF8" | ||
| Style="{StaticResource MaterialDesign3NavigationBarPrimaryListBox}"> | ||
| <ListBox.ItemContainerStyle> | ||
| <Style TargetType="ListBoxItem" BasedOn="{StaticResource MaterialDesign3NavigationBarPrimaryListBoxItem}"> | ||
| <Setter Property="Foreground" Value="#E8DEF8"/> | ||
| <Setter Property="Background" Value="#4A4458"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.SelectedIcon" Value="{Binding SelectedIcon}"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.UnselectedIcon" Value="{Binding UnselectedIcon}"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.IsTextVisible" Value="True"/> | ||
| </Style> | ||
| </ListBox.ItemContainerStyle> | ||
| <ListBox.Resources> | ||
| <DataTemplate DataType="{x:Type domain:SampleItem}"> | ||
| <TextBlock Text="{Binding Title}"/> | ||
| </DataTemplate> | ||
| </ListBox.Resources> | ||
| </ListBox> | ||
| </Grid> | ||
| </StackPanel> | ||
|
|
||
| <StackPanel Margin="0 20 0 0"> | ||
| <TextBlock Text="Custom Size"/> | ||
|
|
||
| <Button Height="96" Width="96" | ||
| Background="#633B48" | ||
| Foreground="#FFD8E4" | ||
| BorderThickness="0" | ||
| HorizontalAlignment="Right" | ||
| VerticalAlignment="Bottom" | ||
| materialDesign:ButtonAssist.CornerRadius="28" | ||
| Margin="16"> | ||
| <materialDesign:PackIcon Kind="PencilOutline" Width="36" Height="36"/> | ||
| </Button> | ||
|
|
||
| <Grid Height="160" | ||
| Background="#25232A"> | ||
| <ListBox ItemsSource="{Binding SampleList}" | ||
| SelectedIndex="0" | ||
| Foreground="#E8DEF8" | ||
| Style="{StaticResource MaterialDesign3NavigationBarPrimaryListBox}"> | ||
| <ListBox.ItemContainerStyle> | ||
| <Style TargetType="ListBoxItem" BasedOn="{StaticResource MaterialDesign3NavigationBarPrimaryListBoxItem}"> | ||
| <Setter Property="Foreground" Value="#E8DEF8"/> | ||
| <Setter Property="Background" Value="#4A4458"/> | ||
| <Setter Property="FontSize" Value="24"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.SelectionHeight" Value="64"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.SelectionWidth" Value="128"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.SelectionCornerRadius" Value="32"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.SelectedIcon" Value="{Binding SelectedIcon}"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.UnselectedIcon" Value="{Binding UnselectedIcon}"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.IsTextVisible" Value="True"/> | ||
| <Setter Property="materialDesign:NavigationBarAssist.IconSize" Value="48"/> | ||
| </Style> | ||
| </ListBox.ItemContainerStyle> | ||
| <ListBox.Resources> | ||
| <DataTemplate DataType="{x:Type domain:SampleItem}"> | ||
| <TextBlock Text="{Binding Title}"/> | ||
| </DataTemplate> | ||
| </ListBox.Resources> | ||
| </ListBox> | ||
| </Grid> | ||
| </StackPanel> | ||
| </StackPanel> | ||
|
|
||
| </Grid> | ||
| </UserControl> | ||
Uh oh!
There was an error while loading. Please reload this page.