Shell - Add page with constructor argument

kyletraynor.4279kyletraynor.4279 USMember ✭✭
edited February 5 in Xamarin.Forms

I'm trying to use the new Shell for Forms 4.0

I have some pages that I would have added in the past like this new GenericPage("link");

Is there a way I can do that with Shell in xaml?

This is what I have now:

    <ShellItem x:Name="RepSpotlight">
        <ShellSection Title="Stats" Icon="tab_feed.png">
            <ShellContent ContentTemplate="{DataTemplate local:Spotlight.StatsPage}" />
        </ShellSection>
        <ShellSection Title="Upcoming" Icon="tab_about.png">
            <ShellContent ContentTemplate="{DataTemplate local:Spotlight.UpcomingPage}"  />
        </ShellSection>
        <ShellSection Title="By Month" Icon="tab_about.png">
            <ShellContent ContentTemplate="{DataTemplate local:Spotlight.ByMonthPage}" />
        </ShellSection>
    </ShellItem>

I'd love to be able to do something like this:

<ShellSection Title="Stats" Icon="tab_feed.png">
<ShellContent ContentTemplate="{DataTemplate local:Spotlight.GenericPage("stats")}" />
</ShellSection>

Or maybe something like:

<ShellSection Title="Stats" Icon="tab_feed.png">
<ShellContent ContentTemplate="{DataTemplate local:Spotlight.GenericPage}" parameter="stats" />
</ShellSection>

Is anything similar to this possible? How would I go about doing it?

Thanks!

Answers

Sign In or Register to comment.