From 6e33e7ae4ebbc78e5cf3c93e8992e7062e42947b Mon Sep 17 00:00:00 2001 From: evandrofadul Date: Fri, 27 Jun 2025 14:55:01 -0300 Subject: [PATCH 1/2] Add IsTopAndFooterSeparatorVisible property to NavigationView component --- .../Controls/NavigationView/INavigationView.cs | 5 +++++ .../NavigationView/NavigationView.Properties.cs | 15 +++++++++++++++ .../NavigationView/NavigationViewCompact.xaml | 6 ++++++ 3 files changed, 26 insertions(+) diff --git a/src/Wpf.Ui/Controls/NavigationView/INavigationView.cs b/src/Wpf.Ui/Controls/NavigationView/INavigationView.cs index 3f8e9aa75..9548bbc89 100644 --- a/src/Wpf.Ui/Controls/NavigationView/INavigationView.cs +++ b/src/Wpf.Ui/Controls/NavigationView/INavigationView.cs @@ -54,6 +54,11 @@ public interface INavigationView /// object? FooterMenuItemsSource { get; set; } + /// + /// Gets or sets a value indicating whether the top and footer separators is visible. + /// + bool IsTopAndFooterSeparatorVisible { get; set; } + /// /// Gets the selected item. /// diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs b/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs index 47aa0758f..6d6990ab6 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs @@ -87,6 +87,14 @@ public partial class NavigationView new FrameworkPropertyMetadata(null, OnFooterMenuItemsSourceChanged) ); + /// Identifies the dependency property. + public static readonly DependencyProperty IsTopAndFooterSeparatorVisibleProperty = DependencyProperty.Register( + nameof(IsTopAndFooterSeparatorVisible), + typeof(bool), + typeof(NavigationView), + new FrameworkPropertyMetadata(true) + ); + /// Identifies the dependency property. public static readonly DependencyProperty ContentOverlayProperty = DependencyProperty.Register( nameof(ContentOverlay), @@ -315,6 +323,13 @@ public object? FooterMenuItemsSource } } + /// + public bool IsTopAndFooterSeparatorVisible + { + get => (bool)GetValue(IsTopAndFooterSeparatorVisibleProperty); + set => SetValue(IsTopAndFooterSeparatorVisibleProperty, value); + } + /// public object? ContentOverlay { diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml b/src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml index 03a7524a3..1c9fd352b 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml @@ -357,6 +357,7 @@ + + + + From 2bf34c5f8b4482d9d70de383d87f49b6b40c25f8 Mon Sep 17 00:00:00 2001 From: evandrofadul Date: Tue, 1 Jul 2025 09:54:44 -0300 Subject: [PATCH 2/2] Split IsTopAndFooterSeparatorVisible into IsTopSeparatorVisible and IsFooterSeparatorVisible --- .../NavigationView/INavigationView.cs | 9 +++++-- .../NavigationView.Properties.cs | 27 ++++++++++++++----- .../NavigationView/NavigationViewCompact.xaml | 4 ++- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/Wpf.Ui/Controls/NavigationView/INavigationView.cs b/src/Wpf.Ui/Controls/NavigationView/INavigationView.cs index 9548bbc89..df33384c5 100644 --- a/src/Wpf.Ui/Controls/NavigationView/INavigationView.cs +++ b/src/Wpf.Ui/Controls/NavigationView/INavigationView.cs @@ -55,9 +55,14 @@ public interface INavigationView object? FooterMenuItemsSource { get; set; } /// - /// Gets or sets a value indicating whether the top and footer separators is visible. + /// Gets or sets a value indicating whether the top separators is visible. /// - bool IsTopAndFooterSeparatorVisible { get; set; } + bool IsTopSeparatorVisible { get; set; } + + /// + /// Gets or sets a value indicating whether the footer separators is visible. + /// + bool IsFooterSeparatorVisible { get; set; } /// /// Gets the selected item. diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs b/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs index 6d6990ab6..43086aa16 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs @@ -87,9 +87,17 @@ public partial class NavigationView new FrameworkPropertyMetadata(null, OnFooterMenuItemsSourceChanged) ); - /// Identifies the dependency property. - public static readonly DependencyProperty IsTopAndFooterSeparatorVisibleProperty = DependencyProperty.Register( - nameof(IsTopAndFooterSeparatorVisible), + /// Identifies the dependency property. + public static readonly DependencyProperty IsTopSeparatorVisibleProperty = DependencyProperty.Register( + nameof(IsTopSeparatorVisible), + typeof(bool), + typeof(NavigationView), + new FrameworkPropertyMetadata(true) + ); + + /// Identifies the dependency property. + public static readonly DependencyProperty IsFooterSeparatorVisibleProperty = DependencyProperty.Register( + nameof(IsFooterSeparatorVisible), typeof(bool), typeof(NavigationView), new FrameworkPropertyMetadata(true) @@ -324,10 +332,17 @@ public object? FooterMenuItemsSource } /// - public bool IsTopAndFooterSeparatorVisible + public bool IsTopSeparatorVisible + { + get => (bool)GetValue(IsTopSeparatorVisibleProperty); + set => SetValue(IsTopSeparatorVisibleProperty, value); + } + + /// + public bool IsFooterSeparatorVisible { - get => (bool)GetValue(IsTopAndFooterSeparatorVisibleProperty); - set => SetValue(IsTopAndFooterSeparatorVisibleProperty, value); + get => (bool)GetValue(IsFooterSeparatorVisibleProperty); + set => SetValue(IsFooterSeparatorVisibleProperty, value); } /// diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml b/src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml index 1c9fd352b..b6ad4dad0 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationViewCompact.xaml @@ -503,8 +503,10 @@ - + + +