/// The methods provided in this section are simply used to allow /// NavigationHelper to respond to the page's navigation methods. /// /// Page specific logic should be placed in event handlers for the /// <see cref="GridCS.Common.NavigationHelper.LoadState"/> /// and <see cref="GridCS.Common.NavigationHelper.SaveState"/>. /// The navigation parameter is available in the LoadState method /// in addition to page state preserved during an earlier session. protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.Parameter is AuthorViewModel) { authorViewModel = e.Parameter as AuthorViewModel; } else if (e.Parameter is String) { authorViewModel = new ViewModels.AuthorViewModel(e.Parameter as string); //authorViewModel.LoadFullData(); //pageTitle.DataContext = authorViewModel; //AuthorPanel.DataContext = authorViewModel; //AboutPanel.DataContext = authorViewModel; } authorViewModel.LoadFullData(); pageTitle.DataContext = authorViewModel; AuthorPanel.DataContext = authorViewModel; AboutPanel.DataContext = authorViewModel; BookPanel.DataContext = authorViewModel; navigationHelper.OnNavigatedTo(e); }
/// <summary> /// /// </summary> /// <param name="args"></param> public async void AuthorClick(RoutedEventArgs args) { var author = new AuthorViewModel(book.Authors[0]); App.NavigationService.Navigate(typeof(AuthorPage), author); }