Announce opening Edit Layout dialog (#13963)

This commit is contained in:
Stefan Markovic
2021-10-22 17:29:02 +02:00
committed by GitHub
parent 399df8ab68
commit a93dc423f0
3 changed files with 16 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -284,6 +284,15 @@ namespace FancyZonesEditor.Properties {
return ResourceManager.GetString("Edit_Layout", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to opened.
/// </summary>
public static string Edit_Layout_Open_Announce {
get {
return ResourceManager.GetString("Edit_Layout_Open_Announce", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Edit zones.

View File

@@ -374,6 +374,9 @@
<data name="Edit_Layout" xml:space="preserve">
<value>Edit layout</value>
</data>
<data name="Edit_Layout_Open_Announce" xml:space="preserve">
<value>opened</value>
</data>
<data name="Layout_Creation_Announce" xml:space="preserve">
<value>custom layout was created successfully.</value>
</data>