Fix: UIA tree not visible for Avalonia content embedded via WinFormsAvaloniaControlHost by AndreyPolovodov · Pull Request #21422 · AvaloniaUI/Avalonia (original) (raw)

added 2 commits

May 22, 2026 21:55

@AndreyPolovodov

@AndreyPolovodov

…onPeer

Without IRootProvider, AutomationNode.Create falls back to the plain AutomationNode which doesn't implement IRawElementProviderFragmentRoot and returns null from GetHostRawElementProvider. As a result, UiaReturnRawElementProvider responds with E_FAIL for the WM_GETOBJECT sent to the embedded HWND, and the Avalonia automation tree is invisible to UIA clients (Inspect.exe, Narrator, FlaUI etc.) when the control is hosted via WinFormsAvaloniaControlHost.

MrJul pushed a commit to MrJul/Avalonia that referenced this pull request

May 28, 2026

@AndreyPolovodov @MrJul

…valoniaControlHost (AvaloniaUI#21422)

Without IRootProvider, AutomationNode.Create falls back to the plain AutomationNode which doesn't implement IRawElementProviderFragmentRoot and returns null from GetHostRawElementProvider. As a result, UiaReturnRawElementProvider responds with E_FAIL for the WM_GETOBJECT sent to the embedded HWND, and the Avalonia automation tree is invisible to UIA clients (Inspect.exe, Narrator, FlaUI etc.) when the control is hosted via WinFormsAvaloniaControlHost.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})