Reputation: 19396
I have MAUI application with two pages. For navigation to the second page, I have this command in the view model of the main page:
[RelayCommand]
Task IrAConfiguracion()
{
return Shell.Current.GoToAsync(nameof(ConfiguracionView));
}
It works well, the second page is shown with an animation, entering from the right.
In my second page, I have this code in the view model to back to the main page:
[RelayCommand]
Task Volver()
{
return Shell.Current.GoToAsync("..");
}
In this case, the main page appears with no animation.
However, if I use the back button of the system or the back button of the navigation bar, then the main page appears with animation, entering from the left.
According to the documentation, Navigation is performed by invoking the GoToAsync method. https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/navigation?view=net-maui-6.0
If the navigation is performing with GoToAsync method, that is the method that I use to back, why doesn't it work when I run my command?
Also it works if I navigate from the main page to the second page, but not when I back, when in both cases I am using the GoToAsync method.
How it could be the cause of this behaviour?
Thanks.
Upvotes: 0
Views: 428
Reputation: 4606
This might be the navigation problem by using the command. I tried to use the command to make the navigation and I found the same problem. But it did not appear on the shell navigation bar or button click event. So it might only be appeared on the command. You can report it as an issue on the Maui.
Upvotes: 1