コード例 #1
0
            protected override void Dispose(bool disposing)
            {
                if (disposing)
                {
                    _sideMenuTransition = null;
                }

                base.Dispose(disposing);
            }
コード例 #2
0
        /**
         * Adds a pan edge gesture to a view to present menus.
         *
         * - Parameter toView: The view to add a pan gesture to.
         *
         * - Returns: The pan gesture added to `toView`.
         */
        public UIPanGestureRecognizer AddPanGestureToPresent(UIView toView)
        {
            var panGestureRecognizer = new UIPanGestureRecognizer();

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

            return(panGestureRecognizer);
        }
コード例 #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;
            }
            UpdateMenuBlurIfNecessary();
        }
コード例 #4
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.Right)
            {
                var leftScreenEdgeGestureRecognizer = new UIScreenEdgePanGestureRecognizer();
                leftScreenEdgeGestureRecognizer.AddTarget(/*SideMenuTransition.Current, */ (_) => SideMenuTransition.HandlePresentMenuLeftScreenEdge(leftScreenEdgeGestureRecognizer));
                leftScreenEdgeGestureRecognizer.Edges = UIRectEdge.Left;
                leftScreenEdgeGestureRecognizer.CancelsTouchesInView = true;
                toView.AddGestureRecognizer(leftScreenEdgeGestureRecognizer);
                gestures.Add(leftScreenEdgeGestureRecognizer);
            }

            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);
        }
コード例 #5
0
 public SideMenuManager()
 {
     SideMenuTransition = new SideMenuTransition(this);
 }
コード例 #6
0
 public SideMenuTransitioningDelegate(SideMenuTransition sideMenuTransition)
 {
     _sideMenuTransition = sideMenuTransition;
 }
コード例 #7
0
 public SideMenuAnimatedTransitioning(SideMenuTransition sideMenuTransition)
 {
     _sideMenuTransition = sideMenuTransition;
 }