Reputation: 143
So when I push an Page over the other:
Shell.Current.Navigation.PushAsync(new XampelPage());
is it possible in the new Page to see the Page that pushed it there? For example if the Background is transparent, is there an way to show it in the Background?
Upvotes: 0
Views: 194
Reputation: 75
You could use a Modal page to accomplish this. In the page you are navigating to, set the property Shell.PressentationMode="ModalAnimated"
. Here's an example of setting that property in the style:
<Style TargetType="base:BaseModalPage" ApplyToDerivedTypes="True"> <!-- Just a custom Page Type I created -->
<Setter Property="BackgroundColor" Value="{StaticResource BackgroundTranslucentColor}" />
<Setter Property="Padding" Value="{StaticResource ModalPaddingThickness}" />
<Setter Property="Shell.PresentationMode" Value="ModalAnimated" />
</Style>
When you navigate with Shell.Current.GoToAsync(...)
, it will push on the stack modally, which will show the previous page behind it if the page is translucent.
Here's a blog post about navigating modally with shell: https://devblogs.microsoft.com/xamarin/xamarin-forms-shell-quick-tip-modal-navigation/
Upvotes: 1
Reputation: 10978
First, for the Shell Stack, when a route from the Shell visual hierarchy is navigated to, a navigation stack isn't created. However, when a page that's not in the Shell visual hierarchy is navigated to, a navigation stack is created.
is it possible in the new Page to see the Page that pushed it there? For example if the Background is transparent, is there an way to show it in the Background?
You could try to use CarouselView to simulate. For more information about the CarouselView, please refer to the link below. https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/carouselview/interaction
Upvotes: 1
Reputation: 1304
I highly doubt that you could see the other page if you push another and set it's background color to Transparent.
You could achieve that using a page with a Grid or absolute layout.These layouts allow you "stack" components
Then you add the new view as a children and start forming the different layers. It would be like a dialog inside a page.
Upvotes: 1