dotnet / dotnet/maui

Reconsider the base page type of any page to be type of TemplatedPage

Open
#8,587 1 comment 0 reactions 0 assignees View on GitHub
area-templates proposal/open t/enhancement ☀️
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 10h
Merged PRs (30d)
297

Description

### Description

It would be great if we could change the control template of any page not only ContentPage. Control templating is very powerful and flexible instrument.

### Public API Changes

Each page will have new property ControlTemplate type of ControlTemplate.

ContentPage now has ContentPresenter inside its ControlTemplate to show the content of the page. but for other pages need to be somthing else.
For example: for MultiPage it could be kind of ItemsPresenter (like in WPF or UWP) instead of ContentPresenter to show multiple pages (if we want pages to be scrollable as CaruoselView). For FlyoutPage it could be ContentPresenter for Detail view and kind of ContentPage with x:Name="PART_Master" for Master view.

Code example:
![image](https://user-images.githubusercontent.com/23138430/177759118-09b2d5bd-1c26-47e8-a995-9a46d2effb3b.png)

![image](https://user-images.githubusercontent.com/23138430/177759305-badad5ee-97cc-4ab6-9009-4659b6590acd.png)

### Intended Use-Case

if I need the custom ui to be added to the page, or if I need the flyout from the right side on FlyoutPage or custom animation, or if I need the custom tabbed page selector etc. I can provide hundreds of examples. But, unfortunately we need to do such things on native side, which is not so useful in context of cross-platform.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.