Skip to content
Discussion options

You must be logged in to vote

Yes, this is possible. You can pass a Dictionary<string, object> parameter now.

object para1 = new();
Dictionary<string, object> parameters = new() { { "para1", para1 } };

await Shell.Current.GoToAsync("YOUR_URI", parameters: parameters, animate: true);

In the ViewModel, you can access the parameter like:

[QueryProperty(nameof(Parameter), "para1")]
    public partial class AppViewModel : BaseViewModel
    {
        #region QueryParameter
        [ObservableProperty]
        protected object parameter;
         //....
     }

The parameter can be any class type, for this example it`s just an object.

For docs, see here: https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/naviga…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ziomek64
Comment options

@AndreasReitberger
Comment options

@ziomek64
Comment options

Answer selected by ziomek64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants