[Enhancement] Make ShellItemView customizable
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 290
Description
## Summary
Since MAUI is fully targeting the Windows desktop does the MAUI team plan on providing more avenues to customize the Shell layout.
For example, the ShellItemView is responsible for applying title, bottom bar, header etc.
However, the creation of the Title (Textblock), BottomBar (UwpGrid), HeaderArea (UwpGrid) are all initialized in the constructor of ShellItemView. The fields backing those objects are private.
```
ShellSectionView SectionRenderer { get; }
TextBlock _Title;
Border _BottomBarArea;
UwpGrid _BottomBar;
UwpGrid _HeaderArea;
ItemsControl _Toolbar;
```
## API Changes
Provide an abstract class for ShellItemView or make more methods in ShellItemView virtual and private fields protected so users can override those values.
e.g.
**Private to Protected**
```
// Responsible for rendering the content title, as well as the bottom bar list of shell sections
public class ShellItemView : UwpGrid, IAppearanceObserver, IFlyoutBehaviorObserver
{
protected ShellSectionView SectionRenderer { get; }
protected TextBlock _Title;
protected Border _BottomBarArea;
protected UwpGrid _BottomBar;
protected UwpGrid _HeaderArea;
protected ItemsControl _Toolbar;
```
Private to Virtual
```
void UpdatePageTitle()
{
_Title.Text = DisplayedPage?.Title ?? ShellSection?.Title ?? "";
}
```
becomes
```
protected virtual void UpdatePageTitle()
{
_Title.Text = DisplayedPage?.Title ?? ShellSection?.Title ?? "";
_Title.IsVisible = !string.IsNullEmptyOrWhitespace(_Title.Text);
}
```
## Intended Use Case
The ability to take advantage of shell features like - navigation items, tabs, routing, etc, but being able to change the look and feel of the layout.
Contributor guide
Research direction
Start by locating the Windows ShellItemView implementation and reviewing how its title, bottom bar, header area, and toolbar are initialized. Compare the proposed abstract-class or protected/virtual-member approaches, then confirm that consumers can customize the Shell layout while retaining navigation items, tabs, and routing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100