Hello,
Firstly, please add Route
property for your <ShellContent>
in the <FlyoutItem>
like following code. The Route
name is the same as page’s name
<FlyoutItem Title="Cats"
>
<Tab>
<ShellContent Route="catepage" ContentTemplate="{DataTemplate local:CatsPage}" />
</Tab>
</FlyoutItem>
Then open the AppShell.xaml.cs
, please override OnNavigated
method. After clicking menu items, you can get the Route
of current page by var currentPageRouteValues = args.Current.Location;
protected override async void OnNavigated(ShellNavigatedEventArgs args)
{
base.OnNavigated(args);
var currentPageRouteValues = args.Current.Location;
await DisplayAlert("info", currentPageRouteValues.ToString(),"OK");
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.