Skip to content

Commit

Permalink
Announce opening Edit Layout dialog (#13963)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansjfw committed Oct 22, 2021
1 parent 399df8a commit a93dc42
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private void DuplicateLayout_Click(object sender, RoutedEventArgs e)
name = name.TrimEnd();
}

AnnounceSuccessfulLayoutCreation(name);
Announce(name, FancyZonesEditor.Properties.Resources.Layout_Creation_Announce);
int maxCustomIndex = 0;
foreach (LayoutModel customModel in MainWindowSettingsModel.CustomModels)
{
Expand Down Expand Up @@ -249,12 +249,12 @@ private void DuplicateLayout_Click(object sender, RoutedEventArgs e)
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);
}
}
Expand Down Expand Up @@ -454,6 +454,7 @@ private async void DeleteLayout(FrameworkElement element)

private void Dialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
{
Announce(sender.Name, FancyZonesEditor.Properties.Resources.Edit_Layout_Open_Announce);
_openedDialog = sender;
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit a93dc42

Please sign in to comment.