Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions src/MainDemo.Wpf/NavigationRail.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -792,5 +792,61 @@
</materialDesign:Card>
</smtx:XamlDisplay>
</StackPanel>

<Rectangle Style="{StaticResource PageSectionSeparator}" />

<TextBlock Style="{StaticResource PageSectionTitleTextBlock}" Text="Additional End Content" />

<smtx:XamlDisplay UniqueKey="navrail_additionalEndContent_1">
<materialDesign:Card>
<TabControl Height="400"
materialDesign:NavigationRailAssist.ShowSelectionBackground="True"
SnapsToDevicePixels="True"
Style="{StaticResource MaterialDesignNavigationRailTabControl}"
TabStripPlacement="Left">
<materialDesign:NavigationRailAssist.AdditionalEndContent>
<StackPanel>
<Button Margin="8"
Background="{DynamicResource MaterialDesign.Brush.ToolBar.Background}"
Content="{materialDesign:PackIcon Kind=Person}"
Style="{StaticResource MaterialDesignIconButton}" />
<Button Margin="8"
Content="{materialDesign:PackIcon Kind=Cog}"
Style="{StaticResource MaterialDesignIconButton}" />
</StackPanel>
</materialDesign:NavigationRailAssist.AdditionalEndContent>
<TabItem>
<TabItem.Header>
<StackPanel Width="auto" Height="auto">
<materialDesign:PackIcon Width="24"
Height="24"
HorizontalAlignment="Center"
Kind="Folder" />
<TextBlock HorizontalAlignment="Center" Text="All Files" />
</StackPanel>
</TabItem.Header>
<TextBlock Margin="16"
Style="{StaticResource MaterialDesignHeadline5TextBlock}"
Text="All Files" />
</TabItem>

<TabItem>
<TabItem.Header>
<StackPanel Width="auto" Height="auto">
<materialDesign:PackIcon Width="24"
Height="24"
HorizontalAlignment="Center"
Kind="ClockOutline" />
<TextBlock HorizontalAlignment="Center" Text="Recent" />
</StackPanel>
</TabItem.Header>
<TextBlock Margin="16"
Style="{StaticResource MaterialDesignHeadline5TextBlock}"
Text="Recent" />
</TabItem>
</TabControl>
</materialDesign:Card>
</smtx:XamlDisplay>

</StackPanel>
</UserControl>
9 changes: 8 additions & 1 deletion src/MaterialDesignThemes.Wpf/NavigationRailAssist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace MaterialDesignThemes.Wpf;

public static class NavigationRailAssist
{
private static readonly CornerRadius DefaultCornerRadius = new CornerRadius(2.0);
private static readonly CornerRadius DefaultCornerRadius = new(2.0);

#region CornerRadius
/// <summary>
Expand All @@ -29,6 +29,13 @@ public static CornerRadius GetCornerRadius(DependencyObject element)

#endregion

#region Property AdditionalEndContent
public static readonly DependencyProperty AdditionalEndContentProperty = DependencyProperty.RegisterAttached(
"AdditionalEndContent", typeof(object), typeof(NavigationRailAssist), new PropertyMetadata(null));
public static object GetAdditionalEndContent(DependencyObject obj) => (object)obj.GetValue(AdditionalEndContentProperty);
public static void SetAdditionalEndContent(DependencyObject obj, object value) => obj.SetValue(AdditionalEndContentProperty, value);
#endregion

#region Property ShowSelectionBackground

public static readonly DependencyProperty ShowSelectionBackgroundProperty = DependencyProperty.RegisterAttached(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -820,10 +820,12 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="1*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="FloatingContentPanel"
Grid.Row="0"
Expand All @@ -842,8 +844,16 @@
IsItemsHost="True"
Rows="0" />

<ContentPresenter x:Name="AdditionalEndContentPresenter"
Grid.Row="2"
Grid.Column="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:NavigationRailAssist.AdditionalEndContent)}"
Focusable="False" />

<Rectangle x:Name="DividerRect"
Grid.RowSpan="2"
Grid.RowSpan="3"
Width="1"
Height="Auto"
HorizontalAlignment="Right"
Expand Down Expand Up @@ -881,7 +891,7 @@
</Trigger>
<Trigger Property="TabStripPlacement" Value="Top">
<Setter Property="BorderThickness" Value="0,0,0,1" />
<Setter TargetName="DividerRect" Property="Grid.ColumnSpan" Value="2" />
<Setter TargetName="DividerRect" Property="Grid.ColumnSpan" Value="3" />
<Setter TargetName="DividerRect" Property="Grid.RowSpan" Value="1" />
<Setter TargetName="DividerRect" Property="Height" Value="1" />
<Setter TargetName="DividerRect" Property="HorizontalAlignment" Value="Stretch" />
Expand All @@ -892,10 +902,12 @@
<Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="HeaderPanel" Property="Rows" Value="1" />
<Setter TargetName="TabGrid" Property="DockPanel.Dock" Value="Top" />
<Setter TargetName="AdditionalEndContentPresenter" Property="Grid.Column" Value="2" />
<Setter TargetName="AdditionalEndContentPresenter" Property="Grid.Row" Value="0" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Bottom">
<Setter Property="BorderThickness" Value="0,1,0,0" />
<Setter TargetName="DividerRect" Property="Grid.ColumnSpan" Value="2" />
<Setter TargetName="DividerRect" Property="Grid.ColumnSpan" Value="3" />
<Setter TargetName="DividerRect" Property="Grid.RowSpan" Value="1" />
<Setter TargetName="DividerRect" Property="Height" Value="1" />
<Setter TargetName="DividerRect" Property="HorizontalAlignment" Value="Stretch" />
Expand All @@ -906,6 +918,8 @@
<Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="HeaderPanel" Property="Rows" Value="1" />
<Setter TargetName="TabGrid" Property="DockPanel.Dock" Value="Bottom" />
<Setter TargetName="AdditionalEndContentPresenter" Property="Grid.Column" Value="2" />
<Setter TargetName="AdditionalEndContentPresenter" Property="Grid.Row" Value="0" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Right">
<Setter Property="BorderThickness" Value="1,0,0,0" />
Expand Down
Loading