protected override void Dispose(bool disposing) { if (disposing) { _sideMenuTransition = null; } base.Dispose(disposing); }
/** * 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); }
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(); }
/** * 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); }
public SideMenuManager() { SideMenuTransition = new SideMenuTransition(this); }
public SideMenuTransitioningDelegate(SideMenuTransition sideMenuTransition) { _sideMenuTransition = sideMenuTransition; }
public SideMenuAnimatedTransitioning(SideMenuTransition sideMenuTransition) { _sideMenuTransition = sideMenuTransition; }