protected override void OnNavigatedFrom(NavigationEventArgs e) { base.OnNavigatedFrom(e); ViewModelBase viewModel = DataContext as ViewModelBase; if (viewModel != null) { viewModel.OnNavigatedFrom(NavigationHelper.FromArgs(e)); } }
protected override void OnNavigatedFrom(NavigationEventArgs e) { base.OnNavigatedFrom(e); NavigationArgs args = NavigationHelper.FromArgs(e); ViewModelBase vm = DataContext as ViewModelBase; if (vm != null) { vm.OnNavigatedFrom(args); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); string parameterKey = e.Parameter as string; ViewModelBase viewModel = DataContext as ViewModelBase; if (viewModel != null) { viewModel.OnNavigatedTo(NavigationHelper.FromArgs(e), parameterKey); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); NavigationArgs args = NavigationHelper.FromArgs(e); string parametersKey = null; if (NavigationContext.QueryString.ContainsKey("key")) { parametersKey = NavigationContext.QueryString["key"]; } ViewModelBase vm = DataContext as ViewModelBase; if (vm != null) { vm.OnNavigatedTo(args, parametersKey); } }