Description
Description
MAUI currently uses a WrapperView
when we need a wrapping control to provide some set of behavior.
Introduce a MauiPlatformView
that users can easily hook into from handlers. This View would also manage all the layout/arrange calls in the way that maui expects them to be call
Related: We should add more docs around using MauiPanel/MauiView/MauiViewGroup
Additional: Rename MauiPanel/MauiView/MauiViewGroup
to MauiPlatformView
and collapse WrapperView
behavior into MauiPlatformView
as well to simplify our classes.
Developers need an easier way to connect into the expectations of how Maui does layouts
MauiPanel/MauiView/MauiViewGroup
already handles a lot of this via ICrossPlatformLayout
but we could make life easier on everyone and recommend they inherit from MauiPlatformView
.
(Public) API Changes
MauiPlatformView
Properties
API | Description |
---|---|
Connected | Indicates when the view is added to the visual hierarchy |
Disconnected | Indicates when the view is removed from the visual hierarchy |
Usage Scenarios
In the handler users could basically do something like this
protected override MyCustomView CreatePlatformView()
{
return new MyCustomView(VirtualView);
}
public MyCustomView : MauiPlatformView
{
public MyCustomView(IView view) : base(view)
{
}
}
Backward Compatibility
N/A
Difficulty
Medium