From 9836313ee880388c904aace7189fd4d74ef04632 Mon Sep 17 00:00:00 2001 From: "James Clarke (WDG)" Date: Wed, 5 Feb 2020 13:42:13 -0800 Subject: [PATCH 1/3] Fix titlebar title position when navigationview is in minimal mode --- src/BuildCast/Helpers/TitleBarHelper.cs | 24 +++++++++++++++++++--- src/BuildCast/Views/NavigationRoot.xaml | 2 +- src/BuildCast/Views/NavigationRoot.xaml.cs | 5 +++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/BuildCast/Helpers/TitleBarHelper.cs b/src/BuildCast/Helpers/TitleBarHelper.cs index 18af67f..2eb78d7 100644 --- a/src/BuildCast/Helpers/TitleBarHelper.cs +++ b/src/BuildCast/Helpers/TitleBarHelper.cs @@ -10,10 +10,12 @@ // THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE. // ****************************************************************** +using System; using System.ComponentModel; using Windows.ApplicationModel.Core; using Windows.UI.Xaml; - +using Windows.UI.Xaml.Controls; + namespace BuildCast.Helpers { public class TitleBarHelper : INotifyPropertyChanged @@ -22,6 +24,7 @@ public class TitleBarHelper : INotifyPropertyChanged private static CoreApplicationViewTitleBar _coreTitleBar; private Thickness _titlePosition; private Visibility _titleVisibility; + private int _extraPadding; /// /// Initializes a new instance of the class. @@ -103,7 +106,22 @@ private Thickness CalculateTilebarOffset(double leftPosition, double height) // top position should be 6 pixels for a 32 pixel high titlebar hence scale by actual height var correctHeight = height / 32 * 6; - return new Thickness(leftPosition + 12, correctHeight, 0, 0); - } + return new Thickness(leftPosition + 12 + _extraPadding, correctHeight, 0, 0); + } + + internal void NavDisplayModeChanged(NavigationView sender, NavigationViewDisplayModeChangedEventArgs args) + { + switch (args.DisplayMode) + { + case NavigationViewDisplayMode.Compact: + _extraPadding = 50; + break; + default: + _extraPadding = 0; + break; + } + + TitlePosition = CalculateTilebarOffset(_coreTitleBar.SystemOverlayLeftInset, _coreTitleBar.Height); + } } } diff --git a/src/BuildCast/Views/NavigationRoot.xaml b/src/BuildCast/Views/NavigationRoot.xaml index 6686e29..59fbcc8 100644 --- a/src/BuildCast/Views/NavigationRoot.xaml +++ b/src/BuildCast/Views/NavigationRoot.xaml @@ -31,7 +31,7 @@ Fill="{StaticResource NavigationViewDefaultPaneBackground}" HorizontalAlignment="Left" Height="1000" Width="48"/> - + diff --git a/src/BuildCast/Views/NavigationRoot.xaml.cs b/src/BuildCast/Views/NavigationRoot.xaml.cs index 6b29693..8bdbb18 100644 --- a/src/BuildCast/Views/NavigationRoot.xaml.cs +++ b/src/BuildCast/Views/NavigationRoot.xaml.cs @@ -199,5 +199,10 @@ public static string ShortDate(DateTime d) return d.ToString("d"); } #endregion + + private void navview_DisplayModeChanged(NavigationView sender, NavigationViewDisplayModeChangedEventArgs args) + { + TitleBarHelper.Instance.NavDisplayModeChanged(sender, args); + } } } From 85e76e16190c3941ccf30473c3566e4bad3d0e5b Mon Sep 17 00:00:00 2001 From: "James Clarke (WDG)" Date: Wed, 5 Feb 2020 13:52:55 -0800 Subject: [PATCH 2/3] Move position of exit button --- src/BuildCast/Views/PopupPlayer.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BuildCast/Views/PopupPlayer.xaml b/src/BuildCast/Views/PopupPlayer.xaml index e989216..5257a08 100644 --- a/src/BuildCast/Views/PopupPlayer.xaml +++ b/src/BuildCast/Views/PopupPlayer.xaml @@ -24,6 +24,6 @@ - + From 086a523baf598ed85a0c1012ea31790e8ea09294 Mon Sep 17 00:00:00 2001 From: "James Clarke (WDG)" Date: Wed, 5 Feb 2020 17:20:53 -0800 Subject: [PATCH 3/3] Add drag and drop for bookmark notes --- src/BuildCast/Views/Notes.xaml | 2 ++ src/BuildCast/Views/Notes.xaml.cs | 30 +++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/BuildCast/Views/Notes.xaml b/src/BuildCast/Views/Notes.xaml index 1779595..57e682e 100644 --- a/src/BuildCast/Views/Notes.xaml +++ b/src/BuildCast/Views/Notes.xaml @@ -119,8 +119,10 @@ ItemClick="NotesListView_Tapped" IsItemClickEnabled="True" SelectionMode="None" + CanDragItems="True" animations:Implicit.ShowAnimations="{StaticResource DefaultListShowAnimations}" animations:Implicit.HideAnimations="{StaticResource DefaultListHideAnimations}" + DragItemsStarting="notesListView_DragItemsStarting" >