From 3026c8f800add89598c10d0b0b319c30dde8806d Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Thu, 29 Sep 2022 12:42:16 -0400 Subject: [PATCH] Remove unneeded closing check (#1910) --- src/Calculator/Views/Calculator.xaml | 2 ++ src/Calculator/Views/Calculator.xaml.cs | 12 ------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Calculator/Views/Calculator.xaml b/src/Calculator/Views/Calculator.xaml index d26dd34b1..9045f1c51 100644 --- a/src/Calculator/Views/Calculator.xaml +++ b/src/Calculator/Views/Calculator.xaml @@ -690,6 +690,7 @@ @@ -788,6 +789,7 @@ x:Uid="MemoryFlyout" AutomationProperties.AutomationId="MemoryFlyout" Closed="OnMemoryFlyoutClosed" + Closing="OnMemoryFlyoutClosing" FlyoutPresenterStyle="{StaticResource MemoryFlyoutStyle}" Opened="OnMemoryFlyoutOpened" Placement="Full"/> diff --git a/src/Calculator/Views/Calculator.xaml.cs b/src/Calculator/Views/Calculator.xaml.cs index d25033468..a280b314c 100644 --- a/src/Calculator/Views/Calculator.xaml.cs +++ b/src/Calculator/Views/Calculator.xaml.cs @@ -225,12 +225,6 @@ private void OnLoaded(object sender, RoutedEventArgs e) string memoryPaneName = AppResourceProvider.GetInstance().GetResourceString("MemoryPane"); MemoryFlyout.FlyoutPresenterStyle.Setters.Add(new Setter(AutomationProperties.NameProperty, memoryPaneName)); - if (Windows.Foundation.Metadata.ApiInformation.IsEventPresent("Windows.UI.Xaml.Controls.Primitives.FlyoutBase", "Closing")) - { - HistoryFlyout.Closing += HistoryFlyout_Closing; - MemoryFlyout.Closing += OnMemoryFlyoutClosing; - } - // Delay load things later when we get a chance. WeakReference weakThis = new WeakReference(this); _ = this.Dispatcher.RunAsync( @@ -650,9 +644,6 @@ private void HistoryFlyout_Closing(FlyoutBase sender, FlyoutBaseClosingEventArgs private void HistoryFlyout_Closed(object sender, object args) { - // Ideally, this would be renamed in the Closing event because the Closed event is too late. - // Closing is not available until RS1+ so we set the name again here for TH2 support. - AutomationProperties.SetName(HistoryButton, m_openHistoryFlyoutAutomationName); m_fIsHistoryFlyoutOpen = false; EnableControls(true); if (HistoryButton.IsEnabled && HistoryButton.Visibility == Visibility.Visible) @@ -745,9 +736,6 @@ private void OnMemoryFlyoutClosing(FlyoutBase sender, FlyoutBaseClosingEventArgs private void OnMemoryFlyoutClosed(object sender, object args) { - // Ideally, this would be renamed in the Closing event because the Closed event is too late. - // Closing is not available until RS1+ so we set the name again here for TH2 support. - AutomationProperties.SetName(MemoryButton, m_openMemoryFlyoutAutomationName); m_fIsMemoryFlyoutOpen = false; EnableControls(true); if (MemoryButton.IsEnabled)