Skip to content

Commit

Permalink
Merge pull request #73311 from Cosifne/dev/shech/accessibilityFix
Browse files Browse the repository at this point in the history
Add AutomationPeer for inheritance marign glyph
  • Loading branch information
Cosifne authored May 3, 2024
2 parents d01b164 + a98afdb commit 27a77e2
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Automation.Peers;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
Expand Down Expand Up @@ -110,6 +111,9 @@ protected override void OnContextMenuOpening(ContextMenuEventArgs e)
base.OnContextMenuOpening(e);
}

protected override AutomationPeer OnCreateAutomationPeer()
=> new InheritanceMarginAutomationPeer(this);

private void LazyInitializeContextMenu()
{
if (ContextMenu is not InheritanceMarginContextMenu)
Expand Down Expand Up @@ -211,4 +215,12 @@ private void ResetFocus()
}
}
}

private sealed class InheritanceMarginAutomationPeer(InheritanceMarginGlyph owner) : ButtonAutomationPeer(owner)
{
protected override AutomationControlType GetAutomationControlTypeCore()
{
return AutomationControlType.Group;
}
}
}

0 comments on commit 27a77e2

Please sign in to comment.