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

Can it work with Shell GoToAsync() ? #37

Closed
jmkyarrow opened this issue Jun 23, 2020 · 3 comments
Closed

Can it work with Shell GoToAsync() ? #37

jmkyarrow opened this issue Jun 23, 2020 · 3 comments
Labels
bug Something isn't working needs info

Comments

@jmkyarrow
Copy link

Expected Behavior

When navigating between pages using Shell.Current.GoToAsync(), there should be a transition as specified.

Actual Behavior

The navigation isn't animated and just cuts from one page to another.

@GiampaoloGabba
Copy link
Owner

GiampaoloGabba commented Aug 5, 2020

Well, honestly, i have never, ever used Shell in my apps outside the demo for this plugin :(
Do you mind to create a simple repro of this issue so i can fork it and work on the Shell Renderer to make it work in such scenario?

Thank you

@GiampaoloGabba GiampaoloGabba added bug Something isn't working needs info labels Aug 7, 2020
@GiampaoloGabba
Copy link
Owner

GiampaoloGabba commented Aug 10, 2020

I made some investigations regarding this issue.
With relative routes (not using the // prefix) everything is working fine, i have updated the shell demo with a GotoAsync between the ImageFromPage and ImageToPage.

Unfortunately, if you are using absolute routes (with // prefix), the shared transition cannot work because within an absolute navigation the new page will replace the navigation stack. This means that every information about the views to transition are destroyed.

More info from the Xamarin.Forms repository:

  • route
    this will search relative to current position and will then go up the hierarchy until a route is found
    page will be pushed to stack

  • /route
    this will search from the root down the hierarchy until a page is found
    page will be pushed to stack

  • //route
    this will search relative to current position and will then go up the hierarchy until a route is found
    page will replace the stack

  • ///route (think of this like //root/route/)
    this will search from the root down the hierarchy until a page is found
    page will replace the stack

If you are using relative routes and still shared transitions doesnt work, please post a repro so i can find the problem :)

@jmkyarrow
Copy link
Author

Thank you for your help, it's working now using relative routes, I really appreciate your effort :)
Do you think there would be a way to have the background animation transition on absolute routes even though individual elements don't work?

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

No branches or pull requests

2 participants