Skip to content

Instantly share code, notes, and snippets.

@lubiepomaranczki
Last active February 3, 2018 17:53
Show Gist options
  • Save lubiepomaranczki/c8dcd93b401baecbad9f8219faf912da to your computer and use it in GitHub Desktop.
Save lubiepomaranczki/c8dcd93b401baecbad9f8219faf912da to your computer and use it in GitHub Desktop.
NavigationService - usage
//In App.xaml.cs
private void ConfigurePages()
{
navigationService.RegisterPage(nameof(Main.Views.WebPage), typeof(Main.Views.WebPage));
navigationService.RegisterPage("Whatever-key-you-want", typeof(Main.Views.WebPage));
}
//In your ViewModel, where you've injected INavigationService as Navigation
//Navigating without params
private void OpenNewsRoom(object obj)
{
Navigation?.NavigateTo("NewsPage");
}
//Navigating with params
private void OpenNews(NewsModel obj)
{
Navigation?.NavigateTo("NewsItemPage", true, (propertyName: "model", param: obj));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment