Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Shell - Add page with constructor argument

$
0
0

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!


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>