sending data with QueryParameters

Eduardo Gomez 4,156 Reputation points
2024-03-08T20:09:47.73+00:00
            var loggedUser = JsonSerializer.Deserialize<DemyUser>(currentUserAsJson);
            FlyoutHeaderHelper.CreateFlyoutHeader(loggedUser);
            var navParams = new Dictionary<string, object>() {
                {"loggedUser", loggedUser!}
            };
            await Shell.Current.GoToAsync($"//{nameof(WelcomePage)}", true, navParams);


My username is "a"

User's image

So is working fine

[QueryProperty(nameof(LoggedUser), "loggedUser")]
public partial class WelcomePageViewModel : BaseViewModel {
    [ObservableProperty]
    DemyUser? loggedUser;
    public WelcomePageViewModel() {
    }
    private void GetShellItems(string? currentRole) {
        throw new NotImplementedException();
    }
}


the problem is that I need to create my Shell Item dynamically, so I need the logged User.

What I do not Understand, is why it appears in the UI

Developer technologies | .NET | .NET MAUI
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.