Skip to content

Navigation and pass parameters. #52

Answered by albyrock87
Midnayt asked this question in Q&A
Discussion options

You must be logged in to vote

You're not the first one asking, so I should probably update the docs with a specific simple example :)

So here it is in the mean time.

Let's say you have your ContactsPageModel and when the user presses on a contact, you want to open a ContactDetailPageModel for the tapped contact.

Inside ContactsPageModel you should have your command (here I'm using CommunityToolkit MVVM as an example).

public Task ContactSelected(Contact contact)
{
    // Create navigation descriptor
    var navigation = Navigation.Relative()
                               .Push<ContactDetailPageModel>()
                               .WithIntent(contact);
    // Invoke Nalu's INavigationService
    return _navigationS…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@CodingOctocat
Comment options

@albyrock87
Comment options

@CodingOctocat
Comment options

@albyrock87
Comment options

Answer selected by Midnayt
Comment options

You must be logged in to vote
1 reply
@albyrock87
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants