コード例 #1
0
    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);
    }
コード例 #2
0
    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();
        }
    }
コード例 #3
0
    public void GoBack(string frameName)
    {
        var navigationFrame = NavigationFrame.GetNavigationFrame(frameName);

        navigationFrame.GoBack();
    }