Exemplo n.º 1
0
        private static void DequeueModalTransition()
        {
            if (ModalQueue.Count < 1 || TransitionInProgress)
            {
                return;
            }

            var state = ModalQueue.Dequeue();

            if (state.ModalController != null)
            {
                TransitionInProgress = true;

                GetTopmostViewController(state.Presenter).PresentViewController(state.ModalController, state.IsAnimated, () =>
                {
                    TransitionInProgress = false;
                    DequeueModalTransition();
                });
            }
            else if (state.Presenter != null && state.Presenter.PresentedViewController != null)
            {
                TransitionInProgress = true;
                state.Presenter.DismissViewController(state.IsAnimated, () =>
                {
                    TransitionInProgress = false;
                    DequeueModalTransition();
                });
            }
        }
Exemplo n.º 2
0
 internal void UnregisterModal(Window control)
 {
     ModalQueue.Remove(control);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Enqueues a modal presentation or dismissal.
 /// </summary>
 /// <param name='presenter'>
 /// The presenting view controller
 /// </param>
 /// <param name='modal'>
 /// The controller to present or null if dismissing the currently presented controller.
 /// </param>
 /// <param name='animated'>
 /// Whether to animate the presentation or dismissal.
 /// </param>
 public static void EnqueueModalTransition(UIViewController presenter, UIViewController modal, bool animated)
 {
     ModalQueue.Enqueue(new ModalTransitionState(presenter, modal, animated));
     DequeueModalTransition();
 }
Exemplo n.º 4
0
 internal void RegisterModal(Window control)
 {
     ModalQueue.Add(control);
 }