Use nameof operator instead of the "Closing" name directly

This commit is contained in:
Rose 2022-09-26 09:46:06 -04:00
commit c9b13ee57e

View file

@ -225,7 +225,7 @@ namespace CalculatorApp
string memoryPaneName = AppResourceProvider.GetInstance().GetResourceString("MemoryPane"); string memoryPaneName = AppResourceProvider.GetInstance().GetResourceString("MemoryPane");
MemoryFlyout.FlyoutPresenterStyle.Setters.Add(new Setter(AutomationProperties.NameProperty, memoryPaneName)); MemoryFlyout.FlyoutPresenterStyle.Setters.Add(new Setter(AutomationProperties.NameProperty, memoryPaneName));
if (Windows.Foundation.Metadata.ApiInformation.IsEventPresent("Windows.UI.Xaml.Controls.Primitives.FlyoutBase", "Closing")) if (Windows.Foundation.Metadata.ApiInformation.IsEventPresent("Windows.UI.Xaml.Controls.Primitives.FlyoutBase", nameof(FlyoutBase.Closing)))
{ {
HistoryFlyout.Closing += HistoryFlyout_Closing; HistoryFlyout.Closing += HistoryFlyout_Closing;
MemoryFlyout.Closing += OnMemoryFlyoutClosing; MemoryFlyout.Closing += OnMemoryFlyoutClosing;