public async Task Interface_contract_changes_can_be_detected() { var ct = CancellationToken.None; var navigator = new BlindSectionsNavigator("Section1", "Section2"); // If the core contract changes, we get compilation errors here. ISectionStackNavigator sectionNavigator = await navigator.SetActiveSection(ct, SectionsNavigatorRequest.GetSetActiveSectionRequest("Section1")); IModalStackNavigator modalNavigator = await navigator.OpenModal(ct, SectionsNavigatorRequest.GetOpenModalRequest(StackNavigation.StackNavigatorRequest.GetNavigateRequest(() => new TestVM()), "modalName", 0)); await navigator.CloseModal(ct, SectionsNavigatorRequest.GetCloseModalRequest("modalName", 0)); }
public async Task Interface_contract_changes_can_be_detected() { var ct = CancellationToken.None; var sectionsNavigator = new BlindSectionsNavigator("Section1", "Section2"); // If the core contract changes, we get compilation errors here. ISectionStackNavigator navigator = await sectionsNavigator.SetActiveSection(ct, SectionsNavigatorRequest.GetSetActiveSectionRequest("Section1")); // Make sure ISectionStackNavigator inherits from IStackNavigator StackNavigation.IStackNavigator stackNavigator = navigator; Assert.Equal("Section1", navigator.Name); }
public SectionsNavigatorState( IReadOnlyDictionary <string, ISectionStackNavigator> sections, ISectionStackNavigator activeSection, IReadOnlyList <IModalStackNavigator> modals, NavigatorRequestState lastRequestState, SectionsNavigatorRequest lastRequest) { Sections = sections; ActiveSection = activeSection; Modals = modals; ActiveModal = modals?.LastOrDefault(); LastRequestState = lastRequestState; LastRequest = lastRequest; }
public async Task Extended_interface_contract_changes_can_be_detected() { var ct = CancellationToken.None; var navigator = new BlindSectionsNavigator("Section1", "Section2"); // If the extension methods available in the abstraction package change their signatures, we get compilation errors here. // Only test extensions specific to ISectionStackNavigator ISectionStackNavigator sectionNavigator1 = await navigator.SetActiveSection(ct, "Section1"); ISectionStackNavigator sectionNavigator2 = await navigator.SetActiveSection(ct, "Section1", () => new TestVM(), true); StackNavigation.IStackNavigator stackNavigator = navigator.GetActiveStackNavigator(); await navigator.OpenModal(ct, () => new TestVM(), 0, "modalName"); bool canNavigateBackOrCloseModal = navigator.CanNavigateBackOrCloseModal(); await navigator.NavigateBackOrCloseModal(ct); IObservable <EventPattern <SectionsNavigatorEventArgs> > ob1 = navigator.ObserveStateChanged(); IObservable <SectionsNavigatorState> ob2 = navigator.ObserveCurrentState(); }
/// <inheritdoc/> protected override Task InnerSetActiveSection(ISectionStackNavigator previousSection, ISectionStackNavigator nextsection, SectionsTransitionInfo transitionInfo) { // Don't do anything. return(Task.CompletedTask); }
/// <inheritdoc cref="StackNavigatorExtensions.TryNavigateBackTo{TPageViewModel}(IStackNavigator, CancellationToken)"/> public static Task <bool> TryNavigateBackTo <TPageViewModel>(this ISectionStackNavigator stackNavigator, CancellationToken ct) { return(StackNavigatorExtensions.TryNavigateBackTo <TPageViewModel>(stackNavigator, ct)); }
/// <inheritdoc cref="StackNavigatorExtensions.GetActiveViewModel(IStackNavigator)"/> public static INavigableViewModel GetActiveViewModel(this ISectionStackNavigator stackNavigator) { return(StackNavigatorExtensions.GetActiveViewModel(stackNavigator)); }
/// <inheritdoc cref="StackNavigatorExtensions.RemovePrevious(IStackNavigator, CancellationToken)"/> public static Task RemovePrevious(this ISectionStackNavigator stackNavigator, CancellationToken ct) { return(StackNavigatorExtensions.RemovePrevious(stackNavigator, ct)); }
/// <inheritdoc cref="StackNavigatorExtensions.Navigate{TViewModel}(IStackNavigator, CancellationToken, Func{TViewModel}, bool)"/> public static Task <TViewModel> Navigate <TViewModel>(this ISectionStackNavigator stackNavigator, CancellationToken ct, Func <TViewModel> viewModelProvider, bool suppressTransition = false) where TViewModel : INavigableViewModel { return(StackNavigatorExtensions.Navigate(stackNavigator, ct, viewModelProvider, suppressTransition)); }
/// <inheritdoc cref="StackNavigatorExtensions.ProcessRequest(IStackNavigator, CancellationToken, StackNavigatorRequest)"/> public static Task ProcessRequest(this ISectionStackNavigator stackNavigator, CancellationToken ct, StackNavigatorRequest request) { return(StackNavigatorExtensions.ProcessRequest(stackNavigator, ct, request)); }
/// <inheritdoc cref="StackNavigatorExtensions.CanNavigateBack(IStackNavigator)"/> public static bool CanNavigateBack(this ISectionStackNavigator stackNavigator) { return(StackNavigatorExtensions.CanNavigateBack(stackNavigator)); }
/// <inheritdoc cref="StackNavigatorReactiveExtensions.ObserveCurrentState(IStackNavigator)"/> public static IObservable <StackNavigatorState> ObserveCurrentState(this ISectionStackNavigator navigator) { return(StackNavigatorReactiveExtensions.ObserveCurrentState(navigator)); }
/// <inheritdoc cref="StackNavigatorReactiveExtensions.ObserveStateChanged(IStackNavigator)"/> public static IObservable <EventPattern <StackNavigatorEventArgs> > ObserveStateChanged(this ISectionStackNavigator navigator) { return(StackNavigatorReactiveExtensions.ObserveStateChanged(navigator)); }