dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.27k stars 1.76k forks source link

WinUI: NavigationPage transitions still animate when passing `animated: false` to PushAsync/PopAsync #11808

Open ArrowCase opened 1 year ago

ArrowCase commented 1 year ago

Description

When using PushAsync and PopAsync with no parameters or when passing animated: true, the page transitions animate from side to side as expected. However, when passing animated: false, a different vertical animation still occurs on Windows 10.

Steps to Reproduce

  1. Create a new MAUI app
  2. Replace MainPage = new AppShell() with MainPage = new NavigationPage(new MainPage()) in App.xaml.cs
  3. Add a second content page and write event handlers in the code behind to allow navigating between the two pages with App.Current.MainPage.Navigation.PushAsync/PopAsync and pass animated: false to those methods.

Expected behavior: There is no transition animation, and the new page appears instantly.

Actual behavior: The new page slides up from the bottom of the screen.

Link to public reproduction project repository

https://github.com/ArrowCase/TestMauiTransition

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows SDK 10.0.19041.0

Did you find any workaround?

For some reason, if the first page is removed from the navigation stack after awaiting the PushAsync call, there is no longer an animation for the transition.

Page firstPage = App.Current.MainPage.Navigation.NavigationStack[^1];
await App.Current.MainPage.Navigation.PushAsync(new SecondPage(), animated: false);
App.Current.MainPage.Navigation.RemovePage(firstPage);

Obviously, this is not a real workaround.

Relevant log output

No response

Myrkai commented 1 year ago

I have the same Issue under Android.

like: Shell.Current.GoToAsync("//sample", false);

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.7.0 Preview 1.0. Repro on Windows 11 with below Project: TestMauiTransition-master.zip

transitions