March 2018
Intermediate to advanced
192 pages
4h 4m
English
With the navigation service completed, we can now update the rest of the TripLog app to leverage it. To start with, we will update the constructor in the main App class in App.xaml.cs to create a new instance of the navigation service and register the app's page-to-ViewModel mappings:
public App(){ var mainPage = new NavigationPage(new MainPage()); var navService = DependencyService.Get<INavService>() as XamarinFormsNavService; navService.XamarinFormsNav = mainPage.Navigation; navService.RegisterViewMapping(typeof(MainViewModel), typeof(MainPage)); navService.RegisterViewMapping(typeof(DetailViewModel), typeof(DetailPage)); navService.RegisterViewMapping(typeof(NewEntryViewModel), typeof(NewEntryPage)); MainPage ...