maui icon indicating copy to clipboard operation
maui copied to clipboard

[Spec] Add better parameters for navigation args

Open PureWeen opened this issue 1 year ago • 5 comments

Description

Currently the navigation args provide no useful information:

We added these args very early on so that we'd be setup to add better information later on.

Here are some suggested additional properties

  • PreviousPage
  • CurrentPage
  • The navigation behavior performed (pop, push, reset, etc...)

PureWeen avatar Apr 13 '24 16:04 PureWeen

Any News around this one @PureWeen ? This is the main show stopper for me to adopt shell?

ederbond avatar Jul 06 '24 16:07 ederbond

Any news around this?

ederbond avatar Aug 02 '24 18:08 ederbond

It has been +2 years since I've reported this bug for MSFT and they didn't come up with a proper solution, so to save your precious time consider completely ditching MAUI AppShell for now, and use the following library to workaround this issue: https://github.com/naveasy/Naveasy

ederbond avatar Aug 02 '24 19:08 ederbond

Any news on this @PureWeen @jfversluis @samhouts ?

FabriBertani avatar Aug 27 '24 00:08 FabriBertani

.NET 9 is just around the corner and I have serious doubt if they are gonna release it despite of asking for it since early days of .NET 6 many years ago with a bunch of details, samples and etc as you can see on the following Issue (which they shamelessly closed without any solution when it reached 2yo and reached the 1st most commented issue here on MAUI GH repo, instead of keeping it open until this api design flaw gets fixed).

https://github.com/dotnet/maui/issues/7354

ederbond avatar Aug 27 '24 00:08 ederbond

In the OnNavigatedTo event of Page, PreviousPage of NavigatedToEventArgs is declared as internal, so it cannot be used.

Is there a reason why you declared PreviousPage as internal? I want PreviousPage to be declared as public.

namespace Microsoft.Maui.Controls { public sealed class NavigatedToEventArgs : EventArgs { internal NavigatedToEventArgs(Page previousPage) { PreviousPage = previousPage; }

internal Page PreviousPage { get; }  <-- Why internal?

} }

gwise-vision avatar Sep 08 '24 15:09 gwise-vision

In the OnNavigatedTo event of Page, PreviousPage of NavigatedToEventArgs is declared as internal, so it cannot be used.

Is there a reason why you declared PreviousPage as internal? I want PreviousPage to be declared as public.

create a new PR for it. There was one, which was closed to no activity from the author.

MagicAndre1981 avatar Sep 08 '24 15:09 MagicAndre1981

See How to use PreviousPage which is hidden internally.

https://github.com/dotnet/maui/pull/21754

gwise-vision avatar Sep 08 '24 15:09 gwise-vision