-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
area-architectureIssues with code structure, SDK structure, implementation detailsIssues with code structure, SDK structure, implementation detailsfixed-in-8.0.0-rc.1.9171Look for this fix in 8.0.0-rc.1.9171Look for this fix in 8.0.0-rc.1.9171proposal/open
Milestone
Description
Description
A number of scenarios have come up where, given just a PlatformView we need to be able to get back to the xplat view. This comes up anytime we are watching an event that originates from the platformview and then we need to figure out how to get this message back to an xplat view. This is going to come up a lot with the Keyboard APIs on iOS where we can only wire into the keyboard methods inside the Controller/Layouts. This also comes up a lot on iOS because we can inherit from every single control #10614.
(Public) API Changes
ViewExtentions
Method
| API | Description |
|---|---|
| GetVisualTreeElement | This will locate the best fit IVisualTreeElement that is associated with this PlatformView. If searchAncestors is false then it will only return the element if the platformView has an exact IVisualTreeElement counterpart. |
IVisualTreeElement GetVisualTreeElement(this PlatformView view, bool searchAncestors, [NotNullWhen(true)] out IVisualTreeElement treeElement)
// searchAncestors defaults to true
IVisualTreeElement GetVisualTreeElement(this PlatformView view)Usage Scenarios
public class MauiUIWindow : UIWindow
{
public override void DidUpdateFocus(UIFocusUpdateContext context, UIFocusAnimationCoordinator coordinator)
{
context.NextFocusedView.GetVisualTreeElement(false)
.IsFocused = true;
context.PreviouslyFocusedView.GetVisualTreeElement(false)
.IsFocused = false;
}
}Backward Compatibility
N/A
Difficulty
Medium
Metadata
Metadata
Assignees
Labels
area-architectureIssues with code structure, SDK structure, implementation detailsIssues with code structure, SDK structure, implementation detailsfixed-in-8.0.0-rc.1.9171Look for this fix in 8.0.0-rc.1.9171Look for this fix in 8.0.0-rc.1.9171proposal/open