From a93dc423f01c7552b57a9d7d35b0dbb508d3bc37 Mon Sep 17 00:00:00 2001 From: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> Date: Fri, 22 Oct 2021 17:29:02 +0200 Subject: [PATCH] Announce opening Edit Layout dialog (#13963) --- .../editor/FancyZonesEditor/MainWindow.xaml.cs | 7 ++++--- .../FancyZonesEditor/Properties/Resources.Designer.cs | 9 +++++++++ .../editor/FancyZonesEditor/Properties/Resources.resx | 3 +++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs b/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs index db920bd935..c8c64f436f 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs @@ -217,7 +217,7 @@ namespace FancyZonesEditor name = name.TrimEnd(); } - AnnounceSuccessfulLayoutCreation(name); + Announce(name, FancyZonesEditor.Properties.Resources.Layout_Creation_Announce); int maxCustomIndex = 0; foreach (LayoutModel customModel in MainWindowSettingsModel.CustomModels) { @@ -249,12 +249,12 @@ namespace FancyZonesEditor App.FancyZonesEditorIO.SerializeZoneSettings(); } - private void AnnounceSuccessfulLayoutCreation(string name) + private void Announce(string name, string message) { if (AutomationPeer.ListenerExists(AutomationEvents.MenuOpened)) { var peer = UIElementAutomationPeer.FromElement(_createLayoutAnnounce); - AutomationProperties.SetName(_createLayoutAnnounce, name + " " + FancyZonesEditor.Properties.Resources.Layout_Creation_Announce); + AutomationProperties.SetName(_createLayoutAnnounce, name + " " + message); peer?.RaiseAutomationEvent(AutomationEvents.MenuOpened); } } @@ -454,6 +454,7 @@ namespace FancyZonesEditor private void Dialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args) { + Announce(sender.Name, FancyZonesEditor.Properties.Resources.Edit_Layout_Open_Announce); _openedDialog = sender; } diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs index 9309724bf0..eee744cdc8 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.Designer.cs @@ -284,6 +284,15 @@ namespace FancyZonesEditor.Properties { return ResourceManager.GetString("Edit_Layout", resourceCulture); } } + + /// + /// Looks up a localized string similar to opened. + /// + public static string Edit_Layout_Open_Announce { + get { + return ResourceManager.GetString("Edit_Layout_Open_Announce", resourceCulture); + } + } /// /// Looks up a localized string similar to Edit zones. diff --git a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx index c0fac817b9..6c51c4b36a 100644 --- a/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx +++ b/src/modules/fancyzones/editor/FancyZonesEditor/Properties/Resources.resx @@ -374,6 +374,9 @@ Edit layout + + opened + custom layout was created successfully.