From 07bd3d27fb8261f1cfff08a613650b64f9349609 Mon Sep 17 00:00:00 2001 From: maj00r Date: Sun, 15 Nov 2026 20:07:26 +0100 Subject: [PATCH] fix: a tree entry tells its state wherever the mouse is on its row MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- StarterNG/Controls/ExpandableTreeViewItem.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/StarterNG/Controls/ExpandableTreeViewItem.cs b/StarterNG/Controls/ExpandableTreeViewItem.cs index 33ddca6..7ab4c6c 100644 --- a/StarterNG/Controls/ExpandableTreeViewItem.cs +++ b/StarterNG/Controls/ExpandableTreeViewItem.cs @@ -49,6 +49,11 @@ public class ExpandableTreeViewItem : TreeViewItem { base.OnApplyTemplate(e); _row = e.NameScope.Find("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(); }