public static void NavigateForResult <TActivity, TParameters, TResult>( [NotNull] this NavigationServiceBase navigationService, [NotNull] IAndroidView <IViewModelWithResultHandler> fromView, [CanBeNull] TParameters parameters, [CanBeNull] ForwardNavigationDelegate navigationStrategy = null) where TActivity : Activity, IActivityView <IViewModelWithParameters <TParameters> >, IActivityView <IViewModelWithResult <TResult> > where TParameters : ViewModelParametersBase where TResult : ViewModelResultBase { if (navigationService == null) { throw new ArgumentNullException(nameof(navigationService)); } if (fromView == null) { throw new ArgumentNullException(nameof(fromView)); } var activity = fromView.GetActivity(); var targetActivityType = typeof(TActivity); var intent = new Intent(activity, targetActivityType); intent.PutViewModelParameters(parameters); var requestCode = RequestCode.Get <TResult>(activity, targetActivityType); (navigationStrategy ?? NavigationStrategy.Forward.Default()).Invoke(fromView, requestCode, intent); }
public static void Navigate <TActivity>( [NotNull] this NavigationServiceBase navigationService, [NotNull] IAndroidView fromView, [CanBeNull] ForwardNavigationDelegate navigationStrategy = null) where TActivity : Activity, IActivityView <IViewModelWithoutParameters> { if (navigationService == null) { throw new ArgumentNullException(nameof(navigationService)); } if (fromView == null) { throw new ArgumentNullException(nameof(fromView)); } var activity = fromView.GetActivity(); var targetActivityType = typeof(TActivity); var intent = new Intent(activity, targetActivityType); (navigationStrategy ?? NavigationStrategy.Forward.Default()).Invoke(fromView, null, intent); }
public static void Navigate( [NotNull] this NavigationServiceBase navigationService, [NotNull] IAndroidView fromView, [NotNull] Type toViewType, [CanBeNull] ForwardNavigationDelegate navigationStrategy = null) { if (navigationService == null) { throw new ArgumentNullException(nameof(navigationService)); } if (fromView == null) { throw new ArgumentNullException(nameof(fromView)); } if (toViewType == null) { throw new ArgumentNullException(nameof(toViewType)); } var activity = fromView.GetActivity(); var intent = new Intent(activity, toViewType); (navigationStrategy ?? NavigationStrategy.Forward.Default()).Invoke(fromView, null, intent); }