-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow embedded root automation peers. #12330
Conversation
You can test this PR using the following package version. |
You can test this PR using the following package version. |
We should use `GetProvider<T>` instead of a plain cast as a peer may decide to dynamically support a provider, or delegate its implementation.
You can test this PR using the following package version. |
The previous commit missed some providers, and we also need to call `GetProvider<T>` when calling members on the provider.
You can test this PR using the following package version. |
Found a few more places that were doing casts instead of calling `GetProvider<T>()`.
You can test this PR using the following package version. |
Arrgh! Forgot to save the file.
You can test this PR using the following package version. |
This reverts commit 0e7b8f6. The code is in the wrong place.
For some reason, on win32 embedded `IRawElementProviderFragmentRoot`s just don't show up, so we need an interface to distinguish between "actual" root peers and "embedded" root peers. Ideally `IRootProvider` and `IEmbeddedRootProvider` would share a common interface but that would be a breaking change.
You can test this PR using the following package version. |
You can test this PR using the following package version. |
This is needed for example when a UI framework hosts a peer in the automation tree of a main window whose control is actually hosted in a popup. It allows the bounding rectangle to be calculated correctly in that case. s
32d1e89
to
c1645ca
Compare
You can test this PR using the following package version. |
Seems it was broken before and always would have returned null.
You can test this PR using the following package version. |
You can test this PR using the following package version. |
Needs to check for `IRootProvider`. Fixes integration tests on Windows.
You can test this PR using the following package version. |
You can test this PR using the following package version. |
What does the pull request do?
Adds a way to allow an embedded 3rd party UI framework to integrate itself in Avalonia's Automation tree, using the Avalonia
AutomationPeer
API.The Avalonia container element for the embedded 3rd party UI framework should expose an automation peer which implements
IEmbeddedRootProvider
. When aControlAutomationPeer
finds a peer which implements this interface, then it will delegate hit testing to that peer. The 3rd party UI framework can then return its ownAutomationPeer
-derived object for the located element.Ideally
IRootProvider
andIEmbeddedRootProvider
would have shared a common interface, but that was not possible without breaking our stable API so they're completely different interfaces for 11.x. This could be fixed for 12.0.Also needed to fix quite a few instances where we were casting a peer to a provider type directly instead of going via
AutomationPeer.GetProvider<T>
.