From b638088a907203576b3dec6c863aeced0fc0b32a Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Tue, 28 Feb 2023 16:04:53 +0900 Subject: [PATCH 1/5] Fixed highlights flickering --- src/Files.App/Helpers/FilePropertiesHelpers.cs | 3 +++ src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs | 3 ++- .../Views/Properties/SecurityAdvancedPage.xaml.cs | 7 ++++--- src/Files.App/Views/Properties/SecurityPage.xaml.cs | 3 +++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Files.App/Helpers/FilePropertiesHelpers.cs b/src/Files.App/Helpers/FilePropertiesHelpers.cs index 1857e7d15940..a901baae5aea 100644 --- a/src/Files.App/Helpers/FilePropertiesHelpers.cs +++ b/src/Files.App/Helpers/FilePropertiesHelpers.cs @@ -85,7 +85,10 @@ public static async Task OpenPropertiesWindowAsync(object item, IShellPage assoc appWindow.SetIcon(LogoPath); if (frame.Content is Views.Properties.MainPropertiesPage properties) + { + properties.Window = propertiesWindow; properties.AppWindow = appWindow; + } appWindow.Show(); diff --git a/src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs b/src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs index 4cb8c2c1ceb6..1635d5273317 100644 --- a/src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs +++ b/src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs @@ -40,6 +40,7 @@ public sealed partial class MainPropertiesPage : Page public SettingsViewModel AppSettings => App.AppSettings; + public Window Window; public AppWindow AppWindow; public ObservableCollection NavViewItems { get; set; } @@ -308,7 +309,7 @@ private void Page_KeyDown(object sender, KeyRoutedEventArgs e) private void ClosePage() { if (_usingWinUI) - AppWindow.Destroy(); + Window.Close(); else _propertiesDialog?.Hide(); } diff --git a/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs b/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs index 7b08a06d399d..79e1444dfc96 100644 --- a/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs +++ b/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs @@ -28,6 +28,7 @@ public sealed partial class SecurityAdvancedPage : Page public SecurityViewModel ViewModel { get; set; } + public Window window; public AppWindow appWindow; public SecurityAdvancedPage() @@ -125,7 +126,7 @@ private async void OKButton_Click(object sender, RoutedEventArgs e) { if (ViewModel.SetFilePermissions()) { - appWindow.Destroy(); + window.Close(); } } else @@ -137,7 +138,7 @@ private async void CancelButton_Click(object sender, RoutedEventArgs e) { if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) { - appWindow.Destroy(); + window.Close(); } else { @@ -150,7 +151,7 @@ private async void Page_KeyDown(object sender, KeyRoutedEventArgs e) { if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) { - appWindow.Destroy(); + window.Close(); } else { diff --git a/src/Files.App/Views/Properties/SecurityPage.xaml.cs b/src/Files.App/Views/Properties/SecurityPage.xaml.cs index ecfff47d4d1f..507421d3e29e 100644 --- a/src/Files.App/Views/Properties/SecurityPage.xaml.cs +++ b/src/Files.App/Views/Properties/SecurityPage.xaml.cs @@ -101,7 +101,10 @@ private void OpenAdvancedProperties() // Set content propertiesWindow.Content = frame; if (frame.Content is SecurityAdvancedPage properties) + { + properties.window = propertiesWindow; properties.appWindow = appWindow; + } // Set min size propertiesWindow.MinWidth = 850; From 04fc2e1ccd2748cb2881d1c8e2298897a08a19d6 Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Tue, 28 Feb 2023 16:09:49 +0900 Subject: [PATCH 2/5] Added comment --- src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs b/src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs index 1635d5273317..6ff7536781b1 100644 --- a/src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs +++ b/src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs @@ -309,7 +309,7 @@ private void Page_KeyDown(object sender, KeyRoutedEventArgs e) private void ClosePage() { if (_usingWinUI) - Window.Close(); + Window.Close(); // AppWindow.Destroy() doesn't seem to work well. (#11461) else _propertiesDialog?.Hide(); } From e361be49aeedb5fe76ae0674fc0ea8bff2c06327 Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Tue, 28 Feb 2023 16:10:45 +0900 Subject: [PATCH 3/5] Added comment --- .../Views/Properties/SecurityAdvancedPage.xaml.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs b/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs index 79e1444dfc96..eb23648795ab 100644 --- a/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs +++ b/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs @@ -126,7 +126,7 @@ private async void OKButton_Click(object sender, RoutedEventArgs e) { if (ViewModel.SetFilePermissions()) { - window.Close(); + window.Close(); // AppWindow.Destroy() doesn't seem to work well. (#11461) } } else @@ -138,7 +138,7 @@ private async void CancelButton_Click(object sender, RoutedEventArgs e) { if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) { - window.Close(); + window.Close(); // AppWindow.Destroy() doesn't seem to work well. (#11461) } else { @@ -151,7 +151,7 @@ private async void Page_KeyDown(object sender, KeyRoutedEventArgs e) { if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) { - window.Close(); + window.Close(); // AppWindow.Destroy() doesn't seem to work well. (#11461) } else { @@ -184,4 +184,4 @@ private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs } } } -} \ No newline at end of file +} From 33513719a718853df32135695b6feedbb27f01d9 Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Wed, 1 Mar 2023 00:29:53 +0900 Subject: [PATCH 4/5] Update SecurityAdvancedPage.xaml.cs --- .../Views/Properties/SecurityAdvancedPage.xaml.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs b/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs index eb23648795ab..7f45303c40a5 100644 --- a/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs +++ b/src/Files.App/Views/Properties/SecurityAdvancedPage.xaml.cs @@ -126,7 +126,8 @@ private async void OKButton_Click(object sender, RoutedEventArgs e) { if (ViewModel.SetFilePermissions()) { - window.Close(); // AppWindow.Destroy() doesn't seem to work well. (#11461) + // AppWindow.Destroy() doesn't seem to work well. (#11461) + window.Close(); } } else @@ -138,7 +139,8 @@ private async void CancelButton_Click(object sender, RoutedEventArgs e) { if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) { - window.Close(); // AppWindow.Destroy() doesn't seem to work well. (#11461) + // AppWindow.Destroy() doesn't seem to work well. (#11461) + window.Close(); } else { @@ -151,7 +153,8 @@ private async void Page_KeyDown(object sender, KeyRoutedEventArgs e) { if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) { - window.Close(); // AppWindow.Destroy() doesn't seem to work well. (#11461) + // AppWindow.Destroy() doesn't seem to work well. (#11461) + window.Close(); } else { From 5f213a80b1cb82b393ac1c263a1abb8d16fd7f7a Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Wed, 1 Mar 2023 00:30:43 +0900 Subject: [PATCH 5/5] Update MainPropertiesPage.xaml.cs --- src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs b/src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs index 6ff7536781b1..c481acb13012 100644 --- a/src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs +++ b/src/Files.App/Views/Properties/MainPropertiesPage.xaml.cs @@ -309,7 +309,8 @@ private void Page_KeyDown(object sender, KeyRoutedEventArgs e) private void ClosePage() { if (_usingWinUI) - Window.Close(); // AppWindow.Destroy() doesn't seem to work well. (#11461) + // AppWindow.Destroy() doesn't seem to work well. (#11461) + Window.Close(); else _propertiesDialog?.Hide(); }