/// <summary> /// Performs backward navigation from the <paramref name="sourceView"/>. /// </summary> /// <param name="sourceView">The source view from which navigation is performed from.</param> /// <param name="navigationStrategy">The strategy used for performing navigation. Default is <see cref="BackwardNavigationStrategy.Finish()"/>.</param> /// <exception cref="ArgumentNullException"><paramref name="sourceView"/> is <c>null</c>.</exception> public void NavigateBack( [NotNull] INavigationView <IViewModel> sourceView, [CanBeNull] BackwardNavigationDelegate navigationStrategy = null) { if (sourceView == null) { throw new ArgumentNullException(nameof(sourceView)); } (navigationStrategy ?? NavigationStrategy.Backward.Finish()).Invoke(sourceView); }
public static void NavigateBack( [NotNull] this NavigationServiceBase navigationService, [NotNull] IActivityView fromView, [CanBeNull] BackwardNavigationDelegate navigationStrategy = null) { if (navigationService == null) { throw new ArgumentNullException(nameof(navigationService)); } if (fromView == null) { throw new ArgumentNullException(nameof(fromView)); } (navigationStrategy ?? NavigationStrategy.Backward.Default()).Invoke(fromView); }
/// <summary> /// Performs backward navigation from the <paramref name="sourceView"/> with a result. /// </summary> /// <typeparam name="TResult">The type of the source view model result.</typeparam> /// <param name="sourceView">The source view from which navigation is performed from.</param> /// <param name="resultCode">Determines whether the result has been set successfully or canceled.</param> /// <param name="result">The source view model result.</param> /// <param name="navigationStrategy">The strategy used for performing navigation. Default is <see cref="BackwardNavigationStrategy.Finish()"/>.</param> /// <exception cref="ArgumentNullException"><paramref name="sourceView"/> is <c>null</c>.</exception> public void NavigateBack <TResult>( [NotNull] INavigationView <IViewModelWithResult <TResult> > sourceView, ResultCode resultCode, [CanBeNull] TResult result, [CanBeNull] BackwardNavigationDelegate navigationStrategy = null) where TResult : Result { if (sourceView == null) { throw new ArgumentNullException(nameof(sourceView)); } var intent = new Intent(); intent.PutResult(result); sourceView.SetResult(resultCode, intent); (navigationStrategy ?? NavigationStrategy.Backward.Finish()).Invoke(sourceView); }
/// <summary> /// Performs backward navigation from the <paramref name="sourceView"/>. /// </summary> /// <param name="sourceView">The source view from which navigation is performed from.</param> /// <param name="animated">Determines if the transition is to be animated.</param> /// <param name="navigationStrategy"> /// The strategy used for performing navigation. /// Default is <see cref="BackwardNavigationStrategy.DismissViewController(Action)"/> if <paramref name="sourceView"/> is being presented or /// <see cref="BackwardNavigationStrategy.PopViewController()"/> if <paramref name="sourceView"/> is being pushed. /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="sourceView"/> is <c>null</c>.</para> /// <para>-or-</para> /// <para><see cref="UINavigationController"/> returned by <paramref name="sourceView"/> is <c>null</c>.</para> /// </exception> public void NavigateBack( [NotNull] INavigationView <IViewModel> sourceView, bool animated, [CanBeNull] BackwardNavigationDelegate navigationStrategy = null) { if (sourceView == null) { throw new ArgumentNullException(nameof(sourceView)); } var navigationController = sourceView.GetNavigationController(); if (navigationController == null) { throw new ArgumentNullException("View's navigation controller is 'null'.", nameof(sourceView)); } (navigationStrategy ?? GetBackwardNavigationStrategy(sourceView)).Invoke(navigationController, sourceView, animated); }
public static void NavigateBack( [NotNull] this NavigationServiceBase navigationService, [NotNull] IIosView fromView, bool animated, [CanBeNull] BackwardNavigationDelegate navigationStrategy = null) { if (navigationService == null) { throw new ArgumentNullException(nameof(navigationService)); } if (fromView == null) { throw new ArgumentNullException(nameof(fromView)); } var navigationController = fromView.GetNavigationController(); (navigationStrategy ?? NavigationStrategy.Backward.Default()).Invoke(navigationController, fromView, animated); }
public static void NavigateBack <TResult>( [NotNull] this NavigationServiceBase navigationService, [NotNull] IActivityView <IViewModelWithResult <TResult> > fromView, ViewModelResultCode resultCode, [CanBeNull] TResult result, [CanBeNull] BackwardNavigationDelegate navigationStrategy = null) where TResult : ViewModelResultBase { if (navigationService == null) { throw new ArgumentNullException(nameof(navigationService)); } if (fromView == null) { throw new ArgumentNullException(nameof(fromView)); } var intent = new Intent(); intent.PutViewModelResult(result); fromView.SetResult(resultCode.ToResult(), intent); (navigationStrategy ?? NavigationStrategy.Backward.Default()).Invoke(fromView); }
/// <summary> /// Performs backward navigation from the <paramref name="sourceView"/> with a result. /// </summary> /// <typeparam name="TResult">The type of the source view model result.</typeparam> /// <param name="sourceView">The source view from which navigation is performed from.</param> /// <param name="resultCode">Determines whether the result has been set successfully or canceled.</param> /// <param name="result">The source view model result.</param> /// <param name="animated">Determines if the transition is to be animated.</param> /// <param name="navigationStrategy"> /// The strategy used for performing navigation. /// Default is <see cref="BackwardNavigationStrategy.DismissViewController(Action)"/> if <paramref name="sourceView"/> is being presented or /// <see cref="BackwardNavigationStrategy.PopViewController()"/> if <paramref name="sourceView"/> is being pushed. /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="sourceView"/> is <c>null</c>.</para> /// <para>-or-</para> /// <para><see cref="UINavigationController"/> returned by <paramref name="sourceView"/> is <c>null</c>.</para> /// </exception> public void NavigateBack <TResult>( [NotNull] INavigationView <IViewModelWithResult <TResult> > sourceView, ResultCode resultCode, [CanBeNull] TResult result, bool animated, [CanBeNull] BackwardNavigationDelegate navigationStrategy = null) where TResult : Result { if (sourceView == null) { throw new ArgumentNullException(nameof(sourceView)); } var navigationController = sourceView.GetNavigationController(); if (navigationController == null) { throw new ArgumentNullException("View's navigation controller is 'null'.", nameof(sourceView)); } sourceView.SetResult(resultCode, result); (navigationStrategy ?? GetBackwardNavigationStrategy(sourceView)).Invoke(navigationController, sourceView, animated); }
public static void NavigateBack <TResult>( [NotNull] this NavigationServiceBase navigationService, [NotNull] IIosView <IViewModelWithResult <TResult> > fromView, ViewModelResultCode resultCode, [CanBeNull] TResult result, bool animated, [CanBeNull] BackwardNavigationDelegate navigationStrategy = null) where TResult : ViewModelResultBase { if (navigationService == null) { throw new ArgumentNullException(nameof(navigationService)); } if (fromView == null) { throw new ArgumentNullException(nameof(fromView)); } fromView.SetResult(resultCode, result); var navigationController = fromView.GetNavigationController(); (navigationStrategy ?? NavigationStrategy.Backward.Default()).Invoke(navigationController, fromView, animated); }