From a45cbbeb65934db4ca09892beed7182f7b08d643 Mon Sep 17 00:00:00 2001 From: Jan Philipp Weber <10946850+jp-weber@users.noreply.github.com> Date: Sun, 27 Oct 2019 21:22:52 +0100 Subject: [PATCH 1/3] root commit From aea62f21253d9b17d3f383b995975d9196881bff Mon Sep 17 00:00:00 2001 From: Jan Philipp Weber <10946850+jp-weber@users.noreply.github.com> Date: Sun, 27 Oct 2019 22:15:43 +0100 Subject: [PATCH 2/3] using Microsoft.UI.Xaml.Controls.NavigationView and implementation of further navigation cases --- .../NavViewEx.cs | 149 +++++------------- .../Template10.Controls.NavViewEx.csproj | 4 + 2 files changed, 46 insertions(+), 107 deletions(-) diff --git a/Source/Template10.Controls.NavViewEx/NavViewEx.cs b/Source/Template10.Controls.NavViewEx/NavViewEx.cs index 8432327ed..e9210c765 100644 --- a/Source/Template10.Controls.NavViewEx/NavViewEx.cs +++ b/Source/Template10.Controls.NavViewEx/NavViewEx.cs @@ -4,20 +4,18 @@ using Windows.UI.Core; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Media; using System.Collections.ObjectModel; using win = Windows; using System.Threading; using Template10.Navigation; using Template10.Services; +using NavigationView = Microsoft.UI.Xaml.Controls.NavigationView; +using NavigationViewItem = Microsoft.UI.Xaml.Controls.NavigationViewItem; namespace Template10.Controls { public class NavViewEx : NavigationView { - private Button _togglePaneButton; - private TextBlock _paneTitleTextBlock; - private Button _backButton; private readonly CoreDispatcher _dispatcher; private readonly Frame _frame; @@ -38,7 +36,7 @@ public NavViewEx() { if (TryFindItem(e.SourcePageType, e.Parameter, out var item)) { - SetSelectedItem(item); + SetSelectedItem(item, false); } }; @@ -53,7 +51,6 @@ public NavViewEx() RegisterPropertyChangedCallback(IsPaneOpenProperty, (s, e) => { - UpdateAppTitleVisibility(); UpdatePaneHeadersVisibility(); }); @@ -64,94 +61,13 @@ public NavViewEx() Loaded += (s, e) => { - UpdateAppTitleVisibility(); UpdatePaneHeadersVisibility(); UpdatePageHeaderContent(); - SetupBackButton(); }; } public INavigationService NavigationService { get; } - private void SetupBackButton() - { - var children = XamlUtilities.RecurseChildren(this); - var grids = children.OfType(); - var grid = grids.Single(x => x.Name == "TogglePaneTopPadding"); - grid.Visibility = Visibility.Collapsed; - - grid = grids.Single(x => x.Name == "ContentPaneTopPadding"); - grid.RegisterPropertyChangedCallback(HeightProperty, (s, args) => - { - if (grid.Height != 44d) - { - grid.Height = 44d; - } - }); - grid.Height = 44d; - - var child_buttons = children.OfType