Skip to content

Commit

Permalink
Remove unneeded closing check (#1910)
Browse files Browse the repository at this point in the history
  • Loading branch information
AreaZR authored Sep 29, 2022
1 parent 1e799d9 commit 3026c8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/Calculator/Views/Calculator.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@
<Flyout x:Name="HistoryFlyout"
AutomationProperties.AutomationId="HistoryFlyout"
Closed="HistoryFlyout_Closed"
Closing="HistoryFlyout_Closing"
FlyoutPresenterStyle="{StaticResource HistoryFlyoutStyle}"
Opened="HistoryFlyout_Opened"
Placement="Full"/>
Expand Down Expand Up @@ -788,6 +789,7 @@
x:Uid="MemoryFlyout"
AutomationProperties.AutomationId="MemoryFlyout"
Closed="OnMemoryFlyoutClosed"
Closing="OnMemoryFlyoutClosing"
FlyoutPresenterStyle="{StaticResource MemoryFlyoutStyle}"
Opened="OnMemoryFlyoutOpened"
Placement="Full"/>
Expand Down
12 changes: 0 additions & 12 deletions src/Calculator/Views/Calculator.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3026c8f

Please sign in to comment.