Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Add IsTopAndFooterSeparatorVisible property to NavigationView component
  • Loading branch information
evandrofadul committed Jun 27, 2025
commit 6e33e7ae4ebbc78e5cf3c93e8992e7062e42947b
5 changes: 5 additions & 0 deletions src/Wpf.Ui/Controls/NavigationView/INavigationView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public interface INavigationView
/// </summary>
object? FooterMenuItemsSource { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the top and footer separators is visible.
/// </summary>
bool IsTopAndFooterSeparatorVisible { get; set; }

/// <summary>
/// Gets the selected item.
/// </summary>
Expand Down
15 changes: 15 additions & 0 deletions src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ public partial class NavigationView
new FrameworkPropertyMetadata(null, OnFooterMenuItemsSourceChanged)
);

/// <summary>Identifies the <see cref="IsTopAndFooterSeparatorVisible"/> dependency property.</summary>
public static readonly DependencyProperty IsTopAndFooterSeparatorVisibleProperty = DependencyProperty.Register(
nameof(IsTopAndFooterSeparatorVisible),
typeof(bool),
typeof(NavigationView),
new FrameworkPropertyMetadata(true)
);

/// <summary>Identifies the <see cref="ContentOverlay"/> dependency property.</summary>
public static readonly DependencyProperty ContentOverlayProperty = DependencyProperty.Register(
nameof(ContentOverlay),
Expand Down Expand Up @@ -315,6 +323,13 @@ public object? FooterMenuItemsSource
}
}

/// <inheritdoc/>
public bool IsTopAndFooterSeparatorVisible
{
get => (bool)GetValue(IsTopAndFooterSeparatorVisibleProperty);
set => SetValue(IsTopAndFooterSeparatorVisibleProperty, value);
}

/// <inheritdoc/>
public object? ContentOverlay
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@

<!-- Separator/Shadow for Top -->
<Border
x:Name="PART_TopSeparator"
Grid.Row="1"
Height="1"
Margin="0,4,0,4"
Expand Down Expand Up @@ -387,6 +388,7 @@

<!-- Separator/Shadow for Footer -->
<Border
x:Name="PART_FooterSeparator"
Grid.Row="3"
Height="1"
Margin="0,4,0,4"
Expand Down Expand Up @@ -501,6 +503,10 @@
<Setter TargetName="PART_ToggleButton" Property="Content" Value="{x:Null}" />
<Setter TargetName="PART_ToggleButton" Property="HorizontalAlignment" Value="Left" />
</Trigger>
<Trigger Property="IsTopAndFooterSeparatorVisible" Value="False">
<Setter TargetName="PART_TopSeparator" Property="Visibility" Value="Collapsed" />
<Setter TargetName="PART_FooterSeparator" Property="Visibility" Value="Collapsed" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>

Expand Down