コード例 #1
0
        public async Task NavigateNextAsync(string tag, CancellationToken token, params KeyValuePair <string, object>[] parameters)
        {
            var data              = GetNavigationData(parameters);
            var currentPage       = Navigation.CurrentPage();
            var nextPage          = _pageBuilder.BuildPage(tag);
            var nextPageViewModel = _viewModelBuilder.BuildViewModel(tag);

            nextPage.BindingContext = nextPageViewModel;

            await _navigationPerformer.PerformNavigationAsync(ENavigationDirrection.NavigatingFrom, currentPage, data, token);

            token.ThrowIfCancellationRequested();
            await _navigationPerformer.PerformNavigationAsync(ENavigationDirrection.Navigating, nextPage, data, token);

            token.ThrowIfCancellationRequested();

            await Navigation.PushAsync(nextPage);

            token.ThrowIfCancellationRequested();

            await _navigationPerformer.PerformNavigationAsync(ENavigationDirrection.NavigatedFrom, currentPage, data, token);

            token.ThrowIfCancellationRequested();
            await _navigationPerformer.PerformNavigationAsync(ENavigationDirrection.Navigated, nextPage, data, token);
        }