From f57f8673fbaedc76c78653167376aeb8773933ee Mon Sep 17 00:00:00 2001 From: Luke Blevins Date: Sun, 21 Mar 2021 17:36:50 -0400 Subject: [PATCH 1/5] Move horizontal TabView out of PaneHolderPage --- Files/App.xaml.cs | 2 -- Files/Views/MainPage.xaml | 32 ++++++++++++++++++++++++++++- Files/Views/MainPage.xaml.cs | 33 +++++++++++++++++++++++++++++- Files/Views/PaneHolderPage.xaml | 16 +-------------- Files/Views/PaneHolderPage.xaml.cs | 14 ------------- 5 files changed, 64 insertions(+), 33 deletions(-) diff --git a/Files/App.xaml.cs b/Files/App.xaml.cs index 0990f8dbba17..b24b1470681b 100644 --- a/Files/App.xaml.cs +++ b/Files/App.xaml.cs @@ -44,9 +44,7 @@ sealed partial class App : Application public static SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1); public static StorageHistoryWrapper HistoryWrapper = new StorageHistoryWrapper(); - public static IBundlesSettings BundlesSettings = new BundlesSettingsViewModel(); - public static SettingsViewModel AppSettings { get; private set; } public static InteractionViewModel InteractionViewModel { get; private set; } public static JumpListManager JumpList { get; } = new JumpListManager(); diff --git a/Files/Views/MainPage.xaml b/Files/Views/MainPage.xaml index 5b494f5e51d5..745319d44bac 100644 --- a/Files/Views/MainPage.xaml +++ b/Files/Views/MainPage.xaml @@ -13,6 +13,9 @@ KeyboardAcceleratorPlacementMode="Hidden" NavigationCacheMode="Required" mc:Ignorable="d"> + + + - + + + + + + + + + \ No newline at end of file diff --git a/Files/Views/MainPage.xaml.cs b/Files/Views/MainPage.xaml.cs index c2befbf48cdb..6571265a90f3 100644 --- a/Files/Views/MainPage.xaml.cs +++ b/Files/Views/MainPage.xaml.cs @@ -33,6 +33,19 @@ namespace Files.Views public sealed partial class MainPage : Page, INotifyPropertyChanged { public SettingsViewModel AppSettings => App.AppSettings; + private double dragReigonWidth; + public double DragRegionWidth + { + get => dragReigonWidth; + set + { + if (value != dragReigonWidth) + { + dragReigonWidth = value; + NotifyPropertyChanged("DragRegionWidth"); + } + } + } public static IMultitaskingControl MultitaskingControl { get; set; } private TabItem selectedTabItem; @@ -62,7 +75,7 @@ public MainPage() ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.Auto; var CoreTitleBar = CoreApplication.GetCurrentView().TitleBar; CoreTitleBar.ExtendViewIntoTitleBar = true; - + CoreTitleBar.LayoutMetricsChanged += TitleBar_LayoutMetricsChanged; var flowDirectionSetting = ResourceContext.GetForCurrentView().QualifierValues["LayoutDirection"]; if (flowDirectionSetting == "RTL") @@ -72,6 +85,24 @@ public MainPage() AllowDrop = true; } + private void TitleBar_LayoutMetricsChanged(CoreApplicationViewTitleBar sender, object args) + { + DragRegionWidth = sender.SystemOverlayRightInset; + } + + private void DragArea_Loaded(object sender, RoutedEventArgs e) + { + Window.Current.SetTitleBar(sender as Grid); + } + + private void HorizontalMultitaskingControl_Loaded(object sender, RoutedEventArgs e) + { + if (!(MultitaskingControl is HorizontalMultitaskingControl)) + { + MultitaskingControl = horizontalMultitaskingControl; + } + } + protected override async void OnNavigatedTo(NavigationEventArgs eventArgs) { if (eventArgs.NavigationMode != NavigationMode.Back) diff --git a/Files/Views/PaneHolderPage.xaml b/Files/Views/PaneHolderPage.xaml index c4f78ccce7f6..b2a44ad29580 100644 --- a/Files/Views/PaneHolderPage.xaml +++ b/Files/Views/PaneHolderPage.xaml @@ -34,8 +34,6 @@ - -