I'm trying to implement the following style of navigation in my UWP app (using Template10) but am struggling how to use the multiple frames as independent history stacks.
Within each frame of the pivot, I'd want to have an independent frame that has it's own history and back stack. Navigating between the frames would only be possible via the pivot.
I was thinking of using code similar to the below:
<Pivot>
<PivotItem Header="PageA">
<Frame x:Name="PageAFrame" />
</PivotItem>
<PivotItem Header="PageB">
<Frame x:Name="PageBFrame" />
</PivotItem>
<PivotItem Header="PageC">
<Frame x:Name="PageCFrame" />
</PivotItem>
</Pivot>
However, I'm not sure how to actually implement the navigation. I've tried using code similar to the below, but with no luck:
var nav = Template10.Services.NavigationService.NavigationService.GetForFrame(PageAFrame);
but nav
is always null.
I've also tried:
PageAFrame.Navigate(typeof(PageA));
But my ViewModels do not get instantiated.
Any ideas?
Note: the reason why I'm not using a hamburger menu is because I need to be able to swap between the pivots but still preserve the independent history stack of each.