Пример #1
0
        protected override void PresentOnMainThread <TInput, TOutput>(ViewModel <TInput, TOutput> viewModel, IView sourceView)
        {
            UIViewController viewController = ViewControllerLocator.GetNavigationViewController(viewModel);

            viewController.ModalPresentationStyle = UIModalPresentationStyle.PageSheet;

            UIViewController topmostViewController = FindPresentedViewController();

            topmostViewController.PresentViewController(viewController, true, null);
        }
Пример #2
0
        protected override void PresentOnMainThread <TInput, TOutput>(ViewModel <TInput, TOutput> viewModel, IView sourceView)
        {
            UIViewController viewController = ViewControllerLocator.GetViewController(viewModel);

            viewController.ModalPresentationStyle = UIModalPresentationStyle.Custom;
            viewController.TransitioningDelegate  = modalTransitionDelegate;

            UIViewController topmostViewController = FindPresentedViewController();

            topmostViewController.PresentViewController(viewController, true, null);
        }
Пример #3
0
        protected override void PresentOnMainThread <TInput, TOutput>(ViewModel <TInput, TOutput> viewModel, IView sourceView)
        {
            UIViewController viewController = ViewControllerLocator.GetNavigationViewController(viewModel);

            viewController.ModalPresentationStyle          = UIModalPresentationStyle.PageSheet;
            viewController.PresentationController.Delegate = new PresentationControllerDelegate(
                () => viewModel.CloseWithDefaultResult());

            UIViewController topmostViewController = FindPresentedViewController();

            topmostViewController.PresentViewController(viewController, true, null);
        }
Пример #4
0
        protected override void PresentOnMainThread <TInput, TOutput>(ViewModel <TInput, TOutput> viewModel, IView view)
        {
            var shouldWrapInNavigationController = !(viewModel is MainTabBarViewModel);
            var rootViewController = shouldWrapInNavigationController
                ? ViewControllerLocator.GetNavigationViewController(viewModel)
                : ViewControllerLocator.GetViewController(viewModel);

            var oldRootViewController = Window.RootViewController;

            UIView.Transition(
                Window,
                Animation.Timings.EnterTiming,
                UIViewAnimationOptions.TransitionCrossDissolve,
                () => Window.RootViewController = rootViewController,
                () => detachOldRootViewController(oldRootViewController)
                );
        }
Пример #5
0
        protected override void PresentOnMainThread <TInput, TOutput>(ViewModel <TInput, TOutput> viewModel, IView view)
        {
            var rootViewController = !viewModelsNotWrappedInNavigationController.Contains(viewModel.GetType())
                ? ViewControllerLocator.GetNavigationViewController(viewModel)
                : ViewControllerLocator.GetViewController(viewModel);

            var oldRootViewController = Window.RootViewController;

            Window.RootViewController = rootViewController;

            UIView.Transition(
                Window,
                Animation.Timings.EnterTiming,
                UIViewAnimationOptions.TransitionCrossDissolve,
                () => { },
                () => detachOldRootViewController(oldRootViewController)
                );
        }
Пример #6
0
        protected override void PresentOnMainThread <TInput, TOutput>(ViewModel <TInput, TOutput> viewModel, IView view)
        {
            UIViewController viewController = ViewControllerLocator.GetViewController(viewModel);

            var presentedViewController = FindPresentedViewController();

            if (tryPushOnViewController(presentedViewController, viewController))
            {
                return;
            }

            if (presentedViewController is UITabBarController tabBarController)
            {
                var selectedController = tabBarController.SelectedViewController;

                if (!tryPushOnViewController(selectedController, viewController))
                {
                    throw new Exception($"Failed to find a navigation controller to present view controller of type {viewController.GetType().Name}");
                }
            }
        }