Ejemplo n.º 1
0
        public UIPanGestureRecognizer AddPanGestureToPresent(UIView toView)
        {
            var panGestureRecognizer = new UIPanGestureRecognizer();

            panGestureRecognizer.AddTarget(/*SideMenuTransition.self, */ () => SideMenuTransition.HandlePresentMenuPan(panGestureRecognizer));
            toView.AddGestureRecognizer(panGestureRecognizer);

            return(panGestureRecognizer);
        }
Ejemplo n.º 2
0
            protected override void Dispose(bool disposing)
            {
                if (disposing)
                {
                    _sideMenuTransition = null;
                }

                base.Dispose(disposing);
            }
Ejemplo n.º 3
0
        void SetupNavigationController(UISideMenuNavigationController forMenu, bool leftSide)
        {
            if (forMenu == null)
            {
                return;
            }

            var exitPanGesture = new UIPanGestureRecognizer();

            exitPanGesture.AddTarget(/*SideMenuTransition.self, */ () => SideMenuTransition.HandleHideMenuPan(exitPanGesture));
            forMenu.View.AddGestureRecognizer(exitPanGesture);
            forMenu.TransitioningDelegate  = SideMenuTransition.TransitioningDelegate;
            forMenu.ModalPresentationStyle = UIModalPresentationStyle.OverFullScreen;
            forMenu.LeftSide = leftSide;
            if (leftSide)
            {
                LeftSwipeToDismissGesture = exitPanGesture;
            }
            else
            {
                RightSwipeToDismissGesture = exitPanGesture;
            }
        }
Ejemplo n.º 4
0
 public SideMenuTransitioningDelegate(SideMenuTransition sideMenuTransition)
 {
     _sideMenuTransition = sideMenuTransition;
 }
Ejemplo n.º 5
0
 public SideMenuAnimatedTransitioning(SideMenuTransition sideMenuTransition)
 {
     _sideMenuTransition = sideMenuTransition;
 }
Ejemplo n.º 6
0
 public SideMenuManager()
 {
     SideMenuTransition = new SideMenuTransition(this);
 }
Ejemplo n.º 7
0
        /**
         * Adds screen edge gestures to a view to present a menu.
         *
         * - Parameter toView: The view to add gestures to.
         * - Parameter forMenu: The menu (left or right) you want to add a gesture for. If unspecified, gestures will be added for both sides.
         *
         * - Returns: The array of screen edge gestures added to `toView`.
         */
        public List <UIScreenEdgePanGestureRecognizer> AddScreenEdgePanGesturesToPresent(UIView toView, UIRectEdge?forMenu = null)
        {
            var gestures = new List <UIScreenEdgePanGestureRecognizer>();

            if (forMenu != UIRectEdge.Left)
            {
                var rightScreenEdgeGestureRecognizer = new UIScreenEdgePanGestureRecognizer();
                rightScreenEdgeGestureRecognizer.AddTarget(/*SideMenuTransition.Current, */ (_) => SideMenuTransition.HandlePresentMenuRightScreenEdge(rightScreenEdgeGestureRecognizer));
                rightScreenEdgeGestureRecognizer.Edges = UIRectEdge.Right;
                rightScreenEdgeGestureRecognizer.CancelsTouchesInView = true;
                toView.AddGestureRecognizer(rightScreenEdgeGestureRecognizer);
                gestures.Add(rightScreenEdgeGestureRecognizer);
            }

            return(gestures);
        }