From d5235f55ad811efc764c2b5624feff619cc22f11 Mon Sep 17 00:00:00 2001 From: d2dyno006 <53011783+d2dyno006@users.noreply.github.com> Date: Mon, 22 Mar 2021 12:02:11 +0100 Subject: [PATCH 1/8] rm1 --- Files/BaseLayout.cs | 51 ------------------ .../BaseLayoutCommandImplementationModel.cs | 53 ++++++++++++++++++ .../Interacts/BaseLayoutCommandsViewModel.cs | 15 ++++++ .../IBaseLayoutCommandImplementationModel.cs | 10 ++++ .../Views/LayoutModes/GenericFileBrowser.xaml | 36 ++++++++++--- Files/Views/LayoutModes/GridViewBrowser.xaml | 54 +++++++++++++++---- 6 files changed, 150 insertions(+), 69 deletions(-) diff --git a/Files/BaseLayout.cs b/Files/BaseLayout.cs index ba1bab687f21..3d8a70ae33f9 100644 --- a/Files/BaseLayout.cs +++ b/Files/BaseLayout.cs @@ -1128,57 +1128,6 @@ protected void UninitializeDrag(UIElement element) public readonly VirtualKey MinusKey = (VirtualKey)189; - public void GridViewSizeIncrease(KeyboardAccelerator sender, KeyboardAcceleratorInvokedEventArgs args) - { - FolderSettings.GridViewSize = FolderSettings.GridViewSize + Constants.Browser.GridViewBrowser.GridViewIncrement; // Make Larger - if (args != null) - { - args.Handled = true; - } - } - - public void GridViewSizeDecrease(KeyboardAccelerator sender, KeyboardAcceleratorInvokedEventArgs args) - { - FolderSettings.GridViewSize = FolderSettings.GridViewSize - Constants.Browser.GridViewBrowser.GridViewIncrement; // Make Smaller - if (args != null) - { - args.Handled = true; - } - } - - public void BaseLayout_PointerWheelChanged(object sender, PointerRoutedEventArgs e) - { - if (e.KeyModifiers == VirtualKeyModifiers.Control) - { - if (e.GetCurrentPoint(null).Properties.MouseWheelDelta < 0) // Mouse wheel down - { - GridViewSizeDecrease(null, null); - } - else // Mouse wheel up - { - GridViewSizeIncrease(null, null); - } - - e.Handled = true; - } - } - - public async void PinItemToStart_Click(object sender, RoutedEventArgs e) - { - foreach (ListedItem listedItem in SelectedItems) - { - await App.SecondaryTileHelper.TryPinFolderAsync(listedItem.ItemPath, listedItem.ItemName); - } - } - - public async void UnpinItemFromStart_Click(object sender, RoutedEventArgs e) - { - foreach (ListedItem listedItem in SelectedItems) - { - await App.SecondaryTileHelper.UnpinFromStartAsync(listedItem.ItemPath); - } - } - public abstract void Dispose(); } } \ No newline at end of file diff --git a/Files/Interacts/BaseLayoutCommandImplementationModel.cs b/Files/Interacts/BaseLayoutCommandImplementationModel.cs index 84623bad2dff..46171d51fa88 100644 --- a/Files/Interacts/BaseLayoutCommandImplementationModel.cs +++ b/Files/Interacts/BaseLayoutCommandImplementationModel.cs @@ -402,6 +402,59 @@ public virtual void ItemPointerPressed(PointerRoutedEventArgs e) } } + public virtual async void UnpinItemFromStart(RoutedEventArgs e) + { + foreach (ListedItem listedItem in associatedInstance.SlimContentPage.SelectedItems) + { + await App.SecondaryTileHelper.UnpinFromStartAsync(listedItem.ItemPath); + } + } + + public async void PinItemToStart(RoutedEventArgs e) + { + foreach (ListedItem listedItem in associatedInstance.SlimContentPage.SelectedItems) + { + await App.SecondaryTileHelper.TryPinFolderAsync(listedItem.ItemPath, listedItem.ItemName); + } + } + + public void PointerWheelChanged(PointerRoutedEventArgs e) + { + if (e.KeyModifiers == VirtualKeyModifiers.Control) + { + if (e.GetCurrentPoint(null).Properties.MouseWheelDelta < 0) // Mouse wheel down + { + GridViewSizeDecrease(null); + } + else // Mouse wheel up + { + GridViewSizeIncrease(null); + } + + e.Handled = true; + } + } + + public void GridViewSizeDecrease(KeyboardAcceleratorInvokedEventArgs e) + { + associatedInstance.InstanceViewModel.FolderSettings.GridViewSize = associatedInstance.InstanceViewModel.FolderSettings.GridViewSize - Constants.Browser.GridViewBrowser.GridViewIncrement; // Make Smaller + + if (e != null) + { + e.Handled = true; + } + } + + public void GridViewSizeIncrease(KeyboardAcceleratorInvokedEventArgs e) + { + associatedInstance.InstanceViewModel.FolderSettings.GridViewSize = associatedInstance.InstanceViewModel.FolderSettings.GridViewSize + Constants.Browser.GridViewBrowser.GridViewIncrement; // Make Larger + + if (e != null) + { + e.Handled = true; + } + } + #endregion Command Implementation } } \ No newline at end of file diff --git a/Files/Interacts/BaseLayoutCommandsViewModel.cs b/Files/Interacts/BaseLayoutCommandsViewModel.cs index 49a3e6f8ca0d..c6887454bfdd 100644 --- a/Files/Interacts/BaseLayoutCommandsViewModel.cs +++ b/Files/Interacts/BaseLayoutCommandsViewModel.cs @@ -60,6 +60,11 @@ private void InitializeCommands() ShareItemCommand = new RelayCommand(commandsModel.ShareItem); PinDirectoryToSidebarCommand = new RelayCommand(commandsModel.PinDirectoryToSidebar); ItemPointerPressedCommand = new RelayCommand(commandsModel.ItemPointerPressed); + UnpinItemFromStartCommand = new RelayCommand(commandsModel.UnpinItemFromStart); + PinItemToStartCommand = new RelayCommand(commandsModel.PinItemToStart); + PointerWheelChangedCommand = new RelayCommand(commandsModel.PointerWheelChanged); + GridViewSizeDecreaseCommand = new RelayCommand(commandsModel.GridViewSizeDecrease); + GridViewSizeIncreaseCommand = new RelayCommand(commandsModel.GridViewSizeIncrease); } #endregion Command Initialization @@ -128,6 +133,16 @@ private void InitializeCommands() public ICommand ItemPointerPressedCommand { get; private set; } + public ICommand UnpinItemFromStartCommand { get; private set; } + + public ICommand PinItemToStartCommand { get; private set; } + + public ICommand PointerWheelChangedCommand { get; private set; } + + public ICommand GridViewSizeDecreaseCommand { get; private set; } + + public ICommand GridViewSizeIncreaseCommand { get; private set; } + #endregion Commands #region IDisposable diff --git a/Files/Interacts/IBaseLayoutCommandImplementationModel.cs b/Files/Interacts/IBaseLayoutCommandImplementationModel.cs index 1dc72ba835f2..d8577b810f2f 100644 --- a/Files/Interacts/IBaseLayoutCommandImplementationModel.cs +++ b/Files/Interacts/IBaseLayoutCommandImplementationModel.cs @@ -67,5 +67,15 @@ public interface IBaseLayoutCommandImplementationModel : IDisposable void PinDirectoryToSidebar(RoutedEventArgs e); void ItemPointerPressed(PointerRoutedEventArgs e); + + void UnpinItemFromStart(RoutedEventArgs e); + + void PinItemToStart(RoutedEventArgs e); + + void PointerWheelChanged(PointerRoutedEventArgs e); + + void GridViewSizeDecrease(KeyboardAcceleratorInvokedEventArgs e); + + void GridViewSizeIncrease(KeyboardAcceleratorInvokedEventArgs e); } } \ No newline at end of file diff --git a/Files/Views/LayoutModes/GenericFileBrowser.xaml b/Files/Views/LayoutModes/GenericFileBrowser.xaml index 96ba15bc54b6..c4124322bddd 100644 --- a/Files/Views/LayoutModes/GenericFileBrowser.xaml +++ b/Files/Views/LayoutModes/GenericFileBrowser.xaml @@ -20,8 +20,12 @@ xmlns:xh="using:Files.Helpers.XamlHelpers" xmlns:usercontrols="using:Files.UserControls" NavigationCacheMode="Enabled" - PointerWheelChanged="BaseLayout_PointerWheelChanged" mc:Ignorable="d"> + + + + + @@ -684,8 +688,12 @@ x:Name="PinItemToStart" x:Uid="PinItemToStart" x:Load="False" - Click="PinItemToStart_Click" Text="Pin to the Start Menu"> + + + + + @@ -694,8 +702,12 @@ x:Name="UnpinItemFromStart" x:Uid="UnpinItemFromStart" x:Load="False" - Click="UnpinItemFromStart_Click" Text="Unpin from the Start Menu"> + + + + + @@ -789,12 +801,22 @@ + Modifiers="Control"> + + + + + + + Modifiers="Control"> + + + + + + diff --git a/Files/Views/LayoutModes/GridViewBrowser.xaml b/Files/Views/LayoutModes/GridViewBrowser.xaml index 1c262825ee22..c61965c360cd 100644 --- a/Files/Views/LayoutModes/GridViewBrowser.xaml +++ b/Files/Views/LayoutModes/GridViewBrowser.xaml @@ -18,8 +18,12 @@ xmlns:xh="using:Files.Helpers.XamlHelpers" x:Name="PageRoot" NavigationCacheMode="Enabled" - PointerWheelChanged="BaseLayout_PointerWheelChanged" mc:Ignorable="d"> + + + + + @@ -651,8 +655,12 @@ x:Name="PinItemToStart" x:Uid="PinItemToStart" x:Load="False" - Click="PinItemToStart_Click" Text="Pin to the Start Menu"> + + + + + @@ -661,8 +669,12 @@ x:Name="UnpinItemFromStart" x:Uid="UnpinItemFromStart" x:Load="False" - Click="UnpinItemFromStart_Click" Text="Unpin from the Start Menu"> + + + + + @@ -1043,20 +1055,40 @@ + Modifiers="Control"> + + + + + + + Modifiers="Control"> + + + + + + + Modifiers="Control"> + + + + + + + Modifiers="Control"> + + + + + + From 57528a53eee2745909d335a4a5d18c8b3ba43408 Mon Sep 17 00:00:00 2001 From: d2dyno006 <53011783+d2dyno006@users.noreply.github.com> Date: Tue, 23 Mar 2021 09:43:38 +0100 Subject: [PATCH 2/8] Fix build error --- Files/Views/LayoutModes/GenericFileBrowser.xaml | 5 +++++ Files/Views/LayoutModes/GridViewBrowser.xaml | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Files/Views/LayoutModes/GenericFileBrowser.xaml b/Files/Views/LayoutModes/GenericFileBrowser.xaml index c4124322bddd..8b9462854dd5 100644 --- a/Files/Views/LayoutModes/GenericFileBrowser.xaml +++ b/Files/Views/LayoutModes/GenericFileBrowser.xaml @@ -44,6 +44,11 @@ x:Name="BaseLayoutContextFlyout" AreOpenCloseAnimationsEnabled="{x:Bind AppSettings.AreRightClickContentMenuAnimationsEnabled, Mode=OneWay}" Opening="RightClickContextMenu_Opening"> + + + + + - - From 684c0cffcceb12a8e01283476648d1b6c8782ae1 Mon Sep 17 00:00:00 2001 From: d2dyno006 <53011783+d2dyno006@users.noreply.github.com> Date: Sat, 27 Mar 2021 14:12:20 +0100 Subject: [PATCH 3/8] Move more commands --- Files/BaseLayout.cs | 70 ----------------- .../BaseLayoutCommandImplementationModel.cs | 76 ++++++++++++++++++- .../Interacts/BaseLayoutCommandsViewModel.cs | 6 ++ .../IBaseLayoutCommandImplementationModel.cs | 4 + .../Views/LayoutModes/GenericFileBrowser.xaml | 8 +- Files/Views/LayoutModes/GridViewBrowser.xaml | 8 +- 6 files changed, 95 insertions(+), 77 deletions(-) diff --git a/Files/BaseLayout.cs b/Files/BaseLayout.cs index 3d8a70ae33f9..7c685100bdbc 100644 --- a/Files/BaseLayout.cs +++ b/Files/BaseLayout.cs @@ -891,76 +891,6 @@ protected virtual void Page_CharacterReceived(CoreWindow sender, CharacterReceiv } } - protected async void List_DragEnter(object sender, DragEventArgs e) - { - var deferral = e.GetDeferral(); - - ClearSelection(); - if (e.DataView.Contains(StandardDataFormats.StorageItems)) - { - e.Handled = true; - e.DragUIOverride.IsCaptionVisible = true; - IEnumerable draggedItems = new List(); - try - { - draggedItems = await e.DataView.GetStorageItemsAsync(); - } - catch (Exception dropEx) when ((uint)dropEx.HResult == 0x80040064) - { - if (Connection != null) - { - await Connection.SendMessageAsync(new ValueSet() { - { "Arguments", "FileOperation" }, - { "fileop", "DragDrop" }, - { "droptext", "DragDropWindowText".GetLocalized() }, - { "droppath", ParentShellPageInstance.FilesystemViewModel.WorkingDirectory } }); - } - } - catch (Exception ex) - { - NLog.LogManager.GetCurrentClassLogger().Warn(ex, ex.Message); - } - if (!draggedItems.Any()) - { - e.AcceptedOperation = DataPackageOperation.None; - deferral.Complete(); - return; - } - - var folderName = Path.GetFileName(ParentShellPageInstance.FilesystemViewModel.WorkingDirectory); - // As long as one file doesn't already belong to this folder - if (InstanceViewModel.IsPageTypeSearchResults || draggedItems.AreItemsAlreadyInFolder(ParentShellPageInstance.FilesystemViewModel.WorkingDirectory)) - { - e.AcceptedOperation = DataPackageOperation.None; - } - else if (draggedItems.AreItemsInSameDrive(ParentShellPageInstance.FilesystemViewModel.WorkingDirectory)) - { - e.DragUIOverride.Caption = string.Format("MoveToFolderCaptionText".GetLocalized(), folderName); - e.AcceptedOperation = DataPackageOperation.Move; - } - else - { - e.DragUIOverride.Caption = string.Format("CopyToFolderCaptionText".GetLocalized(), folderName); - e.AcceptedOperation = DataPackageOperation.Copy; - } - } - - deferral.Complete(); - } - - protected async void List_Drop(object sender, DragEventArgs e) - { - var deferral = e.GetDeferral(); - - if (e.DataView.Contains(StandardDataFormats.StorageItems)) - { - await ParentShellPageInstance.FilesystemHelpers.PerformOperationTypeAsync(e.AcceptedOperation, e.DataView, ParentShellPageInstance.FilesystemViewModel.WorkingDirectory, true); - e.Handled = true; - } - - deferral.Complete(); - } - protected async void Item_DragStarting(object sender, DragStartingEventArgs e) { List selectedStorageItems = new List(); diff --git a/Files/Interacts/BaseLayoutCommandImplementationModel.cs b/Files/Interacts/BaseLayoutCommandImplementationModel.cs index 46171d51fa88..834d09d839f9 100644 --- a/Files/Interacts/BaseLayoutCommandImplementationModel.cs +++ b/Files/Interacts/BaseLayoutCommandImplementationModel.cs @@ -418,7 +418,7 @@ public async void PinItemToStart(RoutedEventArgs e) } } - public void PointerWheelChanged(PointerRoutedEventArgs e) + public virtual void PointerWheelChanged(PointerRoutedEventArgs e) { if (e.KeyModifiers == VirtualKeyModifiers.Control) { @@ -435,7 +435,7 @@ public void PointerWheelChanged(PointerRoutedEventArgs e) } } - public void GridViewSizeDecrease(KeyboardAcceleratorInvokedEventArgs e) + public virtual void GridViewSizeDecrease(KeyboardAcceleratorInvokedEventArgs e) { associatedInstance.InstanceViewModel.FolderSettings.GridViewSize = associatedInstance.InstanceViewModel.FolderSettings.GridViewSize - Constants.Browser.GridViewBrowser.GridViewIncrement; // Make Smaller @@ -445,7 +445,7 @@ public void GridViewSizeDecrease(KeyboardAcceleratorInvokedEventArgs e) } } - public void GridViewSizeIncrease(KeyboardAcceleratorInvokedEventArgs e) + public virtual void GridViewSizeIncrease(KeyboardAcceleratorInvokedEventArgs e) { associatedInstance.InstanceViewModel.FolderSettings.GridViewSize = associatedInstance.InstanceViewModel.FolderSettings.GridViewSize + Constants.Browser.GridViewBrowser.GridViewIncrement; // Make Larger @@ -455,6 +455,76 @@ public void GridViewSizeIncrease(KeyboardAcceleratorInvokedEventArgs e) } } + public virtual async void DragEnter(DragEventArgs e) + { + var deferral = e.GetDeferral(); + + SlimContentPage.ClearSelection(); + if (e.DataView.Contains(StandardDataFormats.StorageItems)) + { + e.Handled = true; + e.DragUIOverride.IsCaptionVisible = true; + IEnumerable draggedItems = new List(); + try + { + draggedItems = await e.DataView.GetStorageItemsAsync(); + } + catch (Exception dropEx) when ((uint)dropEx.HResult == 0x80040064) + { + if (associatedInstance.ServiceConnection != null) + { + await associatedInstance.ServiceConnection.SendMessageAsync(new ValueSet() { + { "Arguments", "FileOperation" }, + { "fileop", "DragDrop" }, + { "droptext", "DragDropWindowText".GetLocalized() }, + { "droppath", associatedInstance.FilesystemViewModel.WorkingDirectory } }); + } + } + catch (Exception ex) + { + NLog.LogManager.GetCurrentClassLogger().Warn(ex, ex.Message); + } + if (!draggedItems.Any()) + { + e.AcceptedOperation = DataPackageOperation.None; + deferral.Complete(); + return; + } + + var folderName = System.IO.Path.GetFileName(associatedInstance.FilesystemViewModel.WorkingDirectory); + // As long as one file doesn't already belong to this folder + if (associatedInstance.InstanceViewModel.IsPageTypeSearchResults || draggedItems.AreItemsAlreadyInFolder(associatedInstance.FilesystemViewModel.WorkingDirectory)) + { + e.AcceptedOperation = DataPackageOperation.None; + } + else if (draggedItems.AreItemsInSameDrive(associatedInstance.FilesystemViewModel.WorkingDirectory)) + { + e.DragUIOverride.Caption = string.Format("MoveToFolderCaptionText".GetLocalized(), folderName); + e.AcceptedOperation = DataPackageOperation.Move; + } + else + { + e.DragUIOverride.Caption = string.Format("CopyToFolderCaptionText".GetLocalized(), folderName); + e.AcceptedOperation = DataPackageOperation.Copy; + } + } + + deferral.Complete(); + } + + public virtual async void Drop(DragEventArgs e) + { + var deferral = e.GetDeferral(); + + if (e.DataView.Contains(StandardDataFormats.StorageItems)) + { + await associatedInstance.FilesystemHelpers.PerformOperationTypeAsync(e.AcceptedOperation, e.DataView, associatedInstance.FilesystemViewModel.WorkingDirectory, true); + e.Handled = true; + } + + deferral.Complete(); + } + #endregion Command Implementation } } \ No newline at end of file diff --git a/Files/Interacts/BaseLayoutCommandsViewModel.cs b/Files/Interacts/BaseLayoutCommandsViewModel.cs index c6887454bfdd..4360e2f43b02 100644 --- a/Files/Interacts/BaseLayoutCommandsViewModel.cs +++ b/Files/Interacts/BaseLayoutCommandsViewModel.cs @@ -65,6 +65,8 @@ private void InitializeCommands() PointerWheelChangedCommand = new RelayCommand(commandsModel.PointerWheelChanged); GridViewSizeDecreaseCommand = new RelayCommand(commandsModel.GridViewSizeDecrease); GridViewSizeIncreaseCommand = new RelayCommand(commandsModel.GridViewSizeIncrease); + DragEnterCommand = new RelayCommand(commandsModel.DragEnter); + DropCommand = new RelayCommand(commandsModel.Drop); } #endregion Command Initialization @@ -143,6 +145,10 @@ private void InitializeCommands() public ICommand GridViewSizeIncreaseCommand { get; private set; } + public ICommand DragEnterCommand { get; private set; } + + public ICommand DropCommand { get; private set; } + #endregion Commands #region IDisposable diff --git a/Files/Interacts/IBaseLayoutCommandImplementationModel.cs b/Files/Interacts/IBaseLayoutCommandImplementationModel.cs index d8577b810f2f..29fc56830820 100644 --- a/Files/Interacts/IBaseLayoutCommandImplementationModel.cs +++ b/Files/Interacts/IBaseLayoutCommandImplementationModel.cs @@ -77,5 +77,9 @@ public interface IBaseLayoutCommandImplementationModel : IDisposable void GridViewSizeDecrease(KeyboardAcceleratorInvokedEventArgs e); void GridViewSizeIncrease(KeyboardAcceleratorInvokedEventArgs e); + + void DragEnter(DragEventArgs e); + + void Drop(DragEventArgs e); } } \ No newline at end of file diff --git a/Files/Views/LayoutModes/GenericFileBrowser.xaml b/Files/Views/LayoutModes/GenericFileBrowser.xaml index 8b9462854dd5..66f3e8ef780d 100644 --- a/Files/Views/LayoutModes/GenericFileBrowser.xaml +++ b/Files/Views/LayoutModes/GenericFileBrowser.xaml @@ -885,8 +885,6 @@ ClipboardCopyMode="None" ColumnHeaderHeight="38" DoubleTapped="AllView_DoubleTapped" - DragEnter="List_DragEnter" - Drop="List_Drop" FocusVisualPrimaryThickness="0" Holding="AllView_Holding" IsDoubleTapEnabled="True" @@ -957,6 +955,12 @@ + + + + + + diff --git a/Files/Views/LayoutModes/GridViewBrowser.xaml b/Files/Views/LayoutModes/GridViewBrowser.xaml index bf89052fda63..7c2493cd853c 100644 --- a/Files/Views/LayoutModes/GridViewBrowser.xaml +++ b/Files/Views/LayoutModes/GridViewBrowser.xaml @@ -1143,8 +1143,6 @@ AllowDrop="{x:Bind InstanceViewModel.IsPageTypeSearchResults, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}" ChoosingItemContainer="FileList_ChoosingItemContainer" DoubleTapped="FileList_DoubleTapped" - DragEnter="List_DragEnter" - Drop="List_Drop" IsDoubleTapEnabled="True" IsItemClickEnabled="True" ItemClick="FileList_ItemClick" @@ -1162,6 +1160,12 @@ + + + + + + Date: Sat, 27 Mar 2021 14:54:56 +0100 Subject: [PATCH 4/8] Fix crash --- .../Views/LayoutModes/GenericFileBrowser.xaml | 51 ++++++++----------- Files/Views/LayoutModes/GridViewBrowser.xaml | 40 +++++++-------- 2 files changed, 40 insertions(+), 51 deletions(-) diff --git a/Files/Views/LayoutModes/GenericFileBrowser.xaml b/Files/Views/LayoutModes/GenericFileBrowser.xaml index 66f3e8ef780d..708b3c502596 100644 --- a/Files/Views/LayoutModes/GenericFileBrowser.xaml +++ b/Files/Views/LayoutModes/GenericFileBrowser.xaml @@ -2,9 +2,6 @@ x:Class="Files.Views.LayoutModes.GenericFileBrowser" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:Core="using:Microsoft.Xaml.Interactions.Core" - xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" - xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors" xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" xmlns:controlsprimitives="using:Microsoft.Toolkit.Uwp.UI.Controls.Primitives" xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" @@ -18,7 +15,6 @@ xmlns:i="using:Microsoft.Xaml.Interactivity" xmlns:icore="using:Microsoft.Xaml.Interactions.Core" xmlns:xh="using:Files.Helpers.XamlHelpers" - xmlns:usercontrols="using:Files.UserControls" NavigationCacheMode="Enabled" mc:Ignorable="d"> @@ -44,11 +40,6 @@ x:Name="BaseLayoutContextFlyout" AreOpenCloseAnimationsEnabled="{x:Bind AppSettings.AreRightClickContentMenuAnimationsEnabled, Mode=OneWay}" Opening="RightClickContextMenu_Opening"> - - - - - - - - + + - - - + + - - - + + - - + + - + @@ -964,27 +955,27 @@ - - + - - - - + + - - - + + - - - + + - - - + + - - - + + - - + + - + - - + - - - + + - - + + From c8cea610d9ee50c2d8ba8d6d969ea1e81824bde9 Mon Sep 17 00:00:00 2001 From: d2dyno006 <53011783+d2dyno006@users.noreply.github.com> Date: Wed, 31 Mar 2021 11:23:12 +0200 Subject: [PATCH 5/8] Some improvements --- Files/Interacts/BaseLayoutCommandsViewModel.cs | 3 ++- Files/Interacts/IBaseLayoutCommandImplementationModel.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Files/Interacts/BaseLayoutCommandsViewModel.cs b/Files/Interacts/BaseLayoutCommandsViewModel.cs index 9a95bf9d61ba..09d8275dac9a 100644 --- a/Files/Interacts/BaseLayoutCommandsViewModel.cs +++ b/Files/Interacts/BaseLayoutCommandsViewModel.cs @@ -136,7 +136,6 @@ private void InitializeCommands() public ICommand PinDirectoryToSidebarCommand { get; private set; } public ICommand ItemPointerPressedCommand { get; private set; } - public ICommand RefreshCommand { get; private set; } public ICommand UnpinItemFromStartCommand { get; private set; } @@ -152,6 +151,8 @@ private void InitializeCommands() public ICommand DropCommand { get; private set; } + public ICommand RefreshCommand { get; private set; } + #endregion Commands #region IDisposable diff --git a/Files/Interacts/IBaseLayoutCommandImplementationModel.cs b/Files/Interacts/IBaseLayoutCommandImplementationModel.cs index 55893361baa5..f8bc8d984563 100644 --- a/Files/Interacts/IBaseLayoutCommandImplementationModel.cs +++ b/Files/Interacts/IBaseLayoutCommandImplementationModel.cs @@ -82,6 +82,7 @@ public interface IBaseLayoutCommandImplementationModel : IDisposable void DragEnter(DragEventArgs e); void Drop(DragEventArgs e); + void RefreshItems(RoutedEventArgs e); } } \ No newline at end of file From c2e20430e06fcecc45ba7a4b8a8df2cabf59c5f7 Mon Sep 17 00:00:00 2001 From: d2dyno006 <53011783+d2dyno006@users.noreply.github.com> Date: Wed, 31 Mar 2021 11:26:36 +0200 Subject: [PATCH 6/8] Added commands to pin folders to start --- Files/Helpers/ContextFlyoutItemHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Files/Helpers/ContextFlyoutItemHelper.cs b/Files/Helpers/ContextFlyoutItemHelper.cs index 75a5719382d9..8248ab8caea1 100644 --- a/Files/Helpers/ContextFlyoutItemHelper.cs +++ b/Files/Helpers/ContextFlyoutItemHelper.cs @@ -486,7 +486,7 @@ public static List GetBaseItemMenuItems(BaseLayo { Text = "PinItemToStart2".GetLocalized(), Glyph = "\uE840", - // TODO: Add command + Command = commandsViewModel.PinItemToStartCommand, ShowOnShift = true, ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsItemPinnedToStart), SingleItemOnly = true, @@ -495,7 +495,7 @@ public static List GetBaseItemMenuItems(BaseLayo { Text = "UnpinItemFromStart2".GetLocalized(), Glyph = "\uE77A", - // TODO: Add command + Command = commandsViewModel.UnpinItemFromStartCommand, ShowOnShift = true, ShowItem = selectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder && x.IsItemPinnedToStart), SingleItemOnly = true, From 577530a976355fe4ebd9f786f3fb9479a46b2344 Mon Sep 17 00:00:00 2001 From: Yair Aichenbaum <39923744+yaichenbaum@users.noreply.github.com> Date: Wed, 31 Mar 2021 15:18:28 -0400 Subject: [PATCH 7/8] Update Files/Helpers/ContextFlyoutItemHelper.cs --- Files/Helpers/ContextFlyoutItemHelper.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Files/Helpers/ContextFlyoutItemHelper.cs b/Files/Helpers/ContextFlyoutItemHelper.cs index 8248ab8caea1..ca74773abb99 100644 --- a/Files/Helpers/ContextFlyoutItemHelper.cs +++ b/Files/Helpers/ContextFlyoutItemHelper.cs @@ -493,7 +493,7 @@ public static List GetBaseItemMenuItems(BaseLayo }, new ContextMenuFlyoutItemViewModel() { - Text = "UnpinItemFromStart2".GetLocalized(), + Text = "UnpinItemFromStart/Text".GetLocalized(), Glyph = "\uE77A", Command = commandsViewModel.UnpinItemFromStartCommand, ShowOnShift = true, @@ -569,4 +569,3 @@ public static List GetNewItemItems(BaseLayoutCom } } } - From d84787d1db001f4aa041fa5deb95fe98f8a676f5 Mon Sep 17 00:00:00 2001 From: Yair Aichenbaum <39923744+yaichenbaum@users.noreply.github.com> Date: Wed, 31 Mar 2021 15:18:35 -0400 Subject: [PATCH 8/8] Update Files/Helpers/ContextFlyoutItemHelper.cs --- Files/Helpers/ContextFlyoutItemHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Files/Helpers/ContextFlyoutItemHelper.cs b/Files/Helpers/ContextFlyoutItemHelper.cs index ca74773abb99..d0730d74651e 100644 --- a/Files/Helpers/ContextFlyoutItemHelper.cs +++ b/Files/Helpers/ContextFlyoutItemHelper.cs @@ -484,7 +484,7 @@ public static List GetBaseItemMenuItems(BaseLayo }, new ContextMenuFlyoutItemViewModel() { - Text = "PinItemToStart2".GetLocalized(), + Text = "PinItemToStart/Text".GetLocalized(), Glyph = "\uE840", Command = commandsViewModel.PinItemToStartCommand, ShowOnShift = true,