fix: a tree entry tells its state wherever the mouse is on its row

Windows passes over the parts of a template when it looks for what lies under the
mouse, so the gaps beside the arrow and after the name led to the entry, which
told no state: NVDA said "Całkowo" there and "Całkowo zwinięte" on the name.
The row is now a control and is found in those gaps.
This commit is contained in:
maj00r
2026-11-15 20:07:26 +01:00
parent ee6da4c8ee
commit 07bd3d27fb

View File

@@ -49,6 +49,11 @@ public class ExpandableTreeViewItem : TreeViewItem
{
base.OnApplyTemplate(e);
_row = e.NameScope.Find<Control>("PART_LayoutRoot");
// A part of a template is passed over when Windows looks for what lies under the
// mouse, so the gaps beside the arrow and the name led to the entry, which told no
// state. As a control the row itself is found there.
if (_row is not null)
AutomationProperties.SetAccessibilityView(_row, AccessibilityView.Control);
TellRowLater();
}