public async Task NavigateAsync <TViewModel, T1, T2>(string frameName, T1 param1, T2 param2) where TViewModel : class, INavigatedAsyncAware <T1, T2> { var navigationFrame = NavigationFrame.GetNavigationFrame(frameName); var view = _viewProvider.ResolvePresentation <TViewModel>(); navigationFrame.Navigate(view); await((INavigatedAsyncAware <T1, T2>)view.DataContext).OnNavigatedAsync(param1, param2); }
public async Task NavigateAsync <TViewModel>(string frameName) where TViewModel : class { var navigationFrame = NavigationFrame.GetNavigationFrame(frameName); var view = _viewProvider.ResolvePresentation <TViewModel>(); navigationFrame.Navigate(view); if (view.DataContext is INavigatedAsyncAware navigationAware) { await navigationAware.OnNavigatedAsync(); } }
public void GoBack(string frameName) { var navigationFrame = NavigationFrame.GetNavigationFrame(frameName); navigationFrame.GoBack(); }