Skip to content

Commit 3026c8f

Browse files
authored
Remove unneeded closing check (#1910)
1 parent 1e799d9 commit 3026c8f

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

src/Calculator/Views/Calculator.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,7 @@
690690
<Flyout x:Name="HistoryFlyout"
691691
AutomationProperties.AutomationId="HistoryFlyout"
692692
Closed="HistoryFlyout_Closed"
693+
Closing="HistoryFlyout_Closing"
693694
FlyoutPresenterStyle="{StaticResource HistoryFlyoutStyle}"
694695
Opened="HistoryFlyout_Opened"
695696
Placement="Full"/>
@@ -788,6 +789,7 @@
788789
x:Uid="MemoryFlyout"
789790
AutomationProperties.AutomationId="MemoryFlyout"
790791
Closed="OnMemoryFlyoutClosed"
792+
Closing="OnMemoryFlyoutClosing"
791793
FlyoutPresenterStyle="{StaticResource MemoryFlyoutStyle}"
792794
Opened="OnMemoryFlyoutOpened"
793795
Placement="Full"/>

src/Calculator/Views/Calculator.xaml.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,6 @@ private void OnLoaded(object sender, RoutedEventArgs e)
225225
string memoryPaneName = AppResourceProvider.GetInstance().GetResourceString("MemoryPane");
226226
MemoryFlyout.FlyoutPresenterStyle.Setters.Add(new Setter(AutomationProperties.NameProperty, memoryPaneName));
227227

228-
if (Windows.Foundation.Metadata.ApiInformation.IsEventPresent("Windows.UI.Xaml.Controls.Primitives.FlyoutBase", "Closing"))
229-
{
230-
HistoryFlyout.Closing += HistoryFlyout_Closing;
231-
MemoryFlyout.Closing += OnMemoryFlyoutClosing;
232-
}
233-
234228
// Delay load things later when we get a chance.
235229
WeakReference weakThis = new WeakReference(this);
236230
_ = this.Dispatcher.RunAsync(
@@ -650,9 +644,6 @@ private void HistoryFlyout_Closing(FlyoutBase sender, FlyoutBaseClosingEventArgs
650644

651645
private void HistoryFlyout_Closed(object sender, object args)
652646
{
653-
// Ideally, this would be renamed in the Closing event because the Closed event is too late.
654-
// Closing is not available until RS1+ so we set the name again here for TH2 support.
655-
AutomationProperties.SetName(HistoryButton, m_openHistoryFlyoutAutomationName);
656647
m_fIsHistoryFlyoutOpen = false;
657648
EnableControls(true);
658649
if (HistoryButton.IsEnabled && HistoryButton.Visibility == Visibility.Visible)
@@ -745,9 +736,6 @@ private void OnMemoryFlyoutClosing(FlyoutBase sender, FlyoutBaseClosingEventArgs
745736

746737
private void OnMemoryFlyoutClosed(object sender, object args)
747738
{
748-
// Ideally, this would be renamed in the Closing event because the Closed event is too late.
749-
// Closing is not available until RS1+ so we set the name again here for TH2 support.
750-
AutomationProperties.SetName(MemoryButton, m_openMemoryFlyoutAutomationName);
751739
m_fIsMemoryFlyoutOpen = false;
752740
EnableControls(true);
753741
if (MemoryButton.IsEnabled)

0 commit comments

Comments
 (0)