Skip to content

[WiP] Create a path where users can inherit from WrapperView (Also rename WrapperView to MauiPlatformView) #23594

Open
@PureWeen

Description

@PureWeen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-architectureIssues with code structure, SDK structure, implementation detailsproposal/opens/triagedIssue has been reviewed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions