0

I am developing a .NET Maui application and utilizing the Shell layout.

I need to showcase a persistent view at the bottom of each page, similar to the Spotify player or the Shell.SearchHandler but above the tabs.

enter image description here

<Shell>
    <TabBar>
        <Tab Title="Home" Icon="home.png">
            <ShellContent ContentTemplate="{DataTemplate page:Home}"/>
        </Tab>
        <Tab Title="Other" Icon="other.png">
            <ShellContent ContentTemplate="{DataTemplate page:Other}"/>
        </Tab>
    </TabBar>
</Shell>

What is the most effective way to accomplish this without duplicating the view code in each individual page?

Adam
  • 51
  • 9
  • Define a custom view, so that all you have to duplicate is a reference to that view: ``. Optionally, define BindableProperties so that each page can customize the custom view. For example, to highlight a different tab. – ToolmakerSteve May 16 '23 at 19:09
  • @ToolmakerSteve Thanks! This is how it currently works, but I would like to separate it from the contentpage (as a custom shellcontent) – Adam May 21 '23 at 12:58
  • @Adam `Shell` doesn't provide that feature. However, you can refer to my previous posts that resembles your scenario: https://stackoverflow.com/a/75279927/9644964, https://stackoverflow.com/questions/75414755/reusable-contentview-net-maui/75445214#75445214 – Alexandar May - MSFT May 22 '23 at 08:53

0 Answers0