navigate Pass data to ViewModel
like maui shell,when ViewModel has IQueryAttributable,that can doing this
but in Page ArgumentAsync method also can doing likeness function
so, i don't sure in this rep to Implement IQueryAttributable function is necessary
and i think Maui QueryProperty is very useful ,but not only can use in Page, also can use in ViewModel
Hello @zyknow Thanks for sharing the idea. I will take how it works and whether we can do it here or not.
I saw that there is a navigate overload in Navigator
Task NavigateAsync(string path, object? argument, CancellationToken cancellationToken = default);
however, the argument is never passed to the target view.
Instead, the OnNavigatingAsync and OnNavigateAsync are only called on the page that is navigated away from.
Am I missing something, or is this a bug/intended?
I'd be willing to work on this feature, if you approve
Hello @gentledepp
You should use the method ArgumentAsync
If you use Page class then override the method otherwise if you use your own base class then implement the INavigationLifecycle and you will have the ArgumentAsync
OnNavigatingAsync allow you to override the parameters of navigating or cancel the navigation. and OnNavigateAsync when navigation is over.
As we do not have activity here for long time, I closing this issue For MVVM pattern and pass data to ViewModel, you can take a looks to our wiki
https://github.com/AvaloniaInside/Shell/wiki/ViewModel-and-State-Example