示例#1
0
        /// <summary>
        /// Returns an existing <see cref="INavigationView{TViewModel}"/> instance by <paramref name="viewModel"/> that can handle a lifecycle-aware view model result.
        /// </summary>
        /// <param name="viewModel">The view model that is used to get its view.</param>
        /// <returns>The navigation view instance.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="viewModel"/> is <see langword="null"/>.</exception>
        /// <exception cref="InvalidOperationException">The view instance is missing for the provided <paramref name="viewModel"/>.</exception>
        public static INavigationView <ILifecycleViewModelWithResultHandler> Get(ILifecycleViewModelWithResultHandler viewModel)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }

            return(ViewCache.Get <INavigationView <ILifecycleViewModelWithResultHandler>, ILifecycleViewModelWithResultHandler>(viewModel));
        }
示例#2
0
        public static IView <IViewModel> Get([NotNull] IViewModel viewModel)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }

            return(ViewCache.Get <IView <IViewModel>, IViewModel>(viewModel));
        }
        public INavigationView <IViewModelWithResultHandler> GetView([NotNull] IViewModelWithResultHandler viewModel)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }

            return(ViewCache.Get <INavigationView <IViewModelWithResultHandler>, IViewModelWithResultHandler>(viewModel));
        }
示例#4
0
        /// <summary>
        /// Returns an existing <see cref="INavigationView{TViewModel}"/> instance by <paramref name="viewModel"/> that can return a lifecycle-aware view model result.
        /// </summary>
        /// <typeparam name="TResult">The type of the view model result.</typeparam>
        /// <param name="viewModel">The view model that is used to get its view.</param>
        /// <returns>The navigation view instance.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="viewModel"/> is <see langword="null"/>.</exception>
        /// <exception cref="InvalidOperationException">The view instance is missing for the provided <paramref name="viewModel"/>.</exception>
        public static INavigationView <ILifecycleViewModelWithResult <TResult> > Get <TResult>(ILifecycleViewModelWithResult <TResult> viewModel)
            where TResult : Result
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }

            return(ViewCache.Get <INavigationView <ILifecycleViewModelWithResult <TResult> >, ILifecycleViewModelWithResult <TResult> >(viewModel));
        }
示例#5
0
        /// <summary>
        /// Returns an existing navigation <typeparamref name="TView"/> derived from the <see cref="Fragment"/> by <paramref name="viewModel"/>.
        /// </summary>
        /// <typeparam name="TView">The type of the view.</typeparam>
        /// <typeparam name="TViewModel">The type of the view model.</typeparam>
        /// <param name="viewModel">The view model that is used to get its view.</param>
        /// <returns>The navigation view instance.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="viewModel"/> is <see langword="null"/>.</exception>
        /// <exception cref="InvalidOperationException">The view instance is missing for the provided <paramref name="viewModel"/>.</exception>
        public static TView GetFragment <TView, TViewModel>(TViewModel viewModel)
            where TView : Fragment, INavigationView <TViewModel>
            where TViewModel : class, ILifecycleViewModel
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }

            return(ViewCache.Get <TView, TViewModel>(viewModel));
        }
示例#6
0
        public TView GetFragment <TView, TViewModel>([NotNull] TViewModel viewModel)
            where TView : Android.Support.V4.App.Fragment, INavigationView <TViewModel>
            where TViewModel : class, IViewModel
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }

            return(ViewCache.Get <TView, TViewModel>(viewModel));
        }
示例#7
0
        public TView GetViewController <TView, TViewModel>([NotNull] TViewModel viewModel)
            where TView : UIViewController, INavigationView <TViewModel>
            where TViewModel : class, IViewModel
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }

            return(ViewCache.Get <TView, TViewModel>(viewModel));
        }