Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it work with Master Detail pages ? #21

Closed
jcaffera opened this issue Jan 16, 2020 · 8 comments
Closed

Does it work with Master Detail pages ? #21

jcaffera opened this issue Jan 16, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@jcaffera
Copy link

Bug Information

Version Number of Plugin: 2.0.2
Simulator Tested On: Android 7.1
Version of VS: 16.4.3
Version of Xamarin: 3.6.0.709228
Prism.DryIoc.Forms 7.2.0.1422

Steps to reproduce the Behavior

While using Prism, if I navigate to "/MasterDetailPage/SharedTransitionNavigationPage/SomePage", and then transition to another page using NavigationService.NavigateTo("SomeOtherPage"), the shared transitions between SomePage and SomeOtherPage won't work. However, they work if I navigate to "/SharedTransitionNavigationPage/SomePage" and then call NavigationService.NavigateTo("SomeOtherPage").

Can you tell if I'm doing something wrong, or missing a step to make it work?
Thanks

@naweed
Copy link

naweed commented Jan 27, 2020

Hi,
I have the exact same issue. If I use MasterDetailPage in Prism, the shared transitions don't work, but without MasterDetailPage, it works perfectly fine. Any solution to this? This is my code in App.xaml.cs:

//Shared Tansitions don't work if wrapped in Master Details Page:
await NavigationService.NavigateAsync($"{nameof(MasterDetailShellPage)}/{nameof(SharedTransitionNavigationPage)}/{nameof(DiscoverPage)}");

//This works:
await NavigationService.NavigateAsync($"{nameof(SharedTransitionNavigationPage)}/{nameof(DiscoverPage)}");

In DiscoverPageViewModel, I am Navigating to another page which has the target transition.

Thanks

@GiampaoloGabba
Copy link
Owner

Uhm.. i tried the masterdetail only on shell (in the relative branch) and it works.

But maybe i found the culprit: when using the transition effect on an element i have to traverse the view hierarchy to find the SharedTransitionNavigationPage to connect the transition.
When using a MasterPage the traverse doesnt go well, i'm planning a fix for this in the new version that will support AndroidX and Shell.

@GiampaoloGabba
Copy link
Owner

Hello, this is fixed in the next version coming very soon!

@GiampaoloGabba GiampaoloGabba added the bug Something isn't working label May 24, 2020
@Strypper
Copy link

Hello did you say you tried it on the shell ? I tried it too but it keep entering break mode
image

@mhrastegari
Copy link

And i still cannot/dunno how to use it for master detail template!

@GiampaoloGabba
Copy link
Owner

Hello did you say you tried it on the shell ? I tried it too but it keep entering break mode
image

Hello, in order to use Shared Transitions with shell you have to use SharedTransitionShell.

Something like this (replacing the Tabs witth your ShellContent):

<sharedTransitions:SharedTransitionShell xmlns="http://xamarin.com/schemas/2014/forms" 
       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

[Here you can find an example using shell](https://github.com/GiampaoloGabba/Xamarin.Plugin.SharedTransitions/tree/master/src/Sample/TransitionShellApp/TransitionShellApp). It use tabs but should be trivial to modify it to make it work with the Flyout
       xmlns:sharedTransitions="clr-namespace:Plugin.SharedTransitions;assembly=Plugin.SharedTransitions"
       Title="TransitionShellApp"
       x:Class="TransitionShellApp.AppShell">

    <!-- Your Pages -->
    <TabBar>
        ....
    </TabBar>
</sharedTransitions:SharedTransitionShell>

You can not use a SharedTransitionNavigationPage inside a Shell

@GiampaoloGabba
Copy link
Owner

And i still cannot/dunno how to use it for master detail template!

Hello, in the sample app there is a full example of shared transitions inside a MasterDetailPage, you can find it here

@mhrastegari
Copy link

Hi, i think i missed something here, can you help me? i saw that sample but still crashing :(

Snapshot_20-06-23_00-14-53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants