public void OpenAnimation(MenuLocations menuLocation, int menuWidth) { if (menuLocation == MenuLocations.Right){ ContentViewController.View.Frame = new RectangleF (-menuWidth, 0, ContentViewController.View.Frame.Width, ContentViewController.View.Frame.Height); } else if(menuLocation == MenuLocations.Left){ ContentViewController.View.Frame = new RectangleF (menuWidth, 0, ContentViewController.View.Frame.Width, ContentViewController.View.Frame.Height); } }
public void OpenAnimation(MenuLocations menuLocation, int menuWidth) { if (menuLocation == MenuLocations.Right) { ContentViewController.View.Frame = new RectangleF(-menuWidth, 0, ContentViewController.View.Frame.Width, ContentViewController.View.Frame.Height); } else if (menuLocation == MenuLocations.Left) { ContentViewController.View.Frame = new RectangleF(menuWidth, 0, ContentViewController.View.Frame.Width, ContentViewController.View.Frame.Height); } }
private bool PanGestureInActiveArea(UIPanGestureRecognizer panGesture, MenuLocations menuLocation, nfloat gestureActiveArea) { var position = panGesture.LocationInView(ContentViewController.View).X; if (menuLocation == MenuLocations.Left) { return(position > gestureActiveArea); } else { return(position < ContentViewController.View.Bounds.Width - gestureActiveArea); } }
private void ShowShadowWhileDragging(bool hasShadowing, MenuLocations menuLocation) { if (!hasShadowing) { return; } var xOffset = (menuLocation == MenuLocations.Left) ? -5 : 5; ContentViewController.View.Layer.ShadowOffset = new SizeF(xOffset, 0); ContentViewController.View.Layer.ShadowPath = UIBezierPath.FromRect(ContentViewController.View.Bounds).CGPath; ContentViewController.View.Layer.ShadowRadius = ShadowRadius; ContentViewController.View.Layer.ShadowOpacity = ShadowOpacity; ContentViewController.View.Layer.ShadowColor = ShadowColor.CGColor; }
private void PanBegan(UIPanGestureRecognizer panGesture, MenuLocations menuLocation, nfloat gestureActiveArea) { _panOriginX = ContentViewController.View.Frame.X; _ignorePan = PanGestureInActiveArea(panGesture, menuLocation, gestureActiveArea); }
private void ShowShadowWhileDragging(bool hasShadowing, MenuLocations menuLocation) { if (!hasShadowing) return; var xOffset = (menuLocation == MenuLocations.Left) ? -5 : 5; ContentViewController.View.Layer.ShadowOffset = new SizeF(xOffset, 0); ContentViewController.View.Layer.ShadowPath = UIBezierPath.FromRect (ContentViewController.View.Bounds).CGPath; ContentViewController.View.Layer.ShadowRadius = 4.0f; ContentViewController.View.Layer.ShadowOpacity = 0.5f; ContentViewController.View.Layer.ShadowColor = UIColor.Black.CGColor; }
private bool PanGestureInActiveArea(UIPanGestureRecognizer panGesture, MenuLocations menuLocation, nfloat gestureActiveArea) { var position = panGesture.LocationInView(ContentViewController.View).X; if (menuLocation == MenuLocations.Left) return position > gestureActiveArea; else return position < ContentViewController.View.Bounds.Width - gestureActiveArea; }
private void PanBegan(UIPanGestureRecognizer panGesture, MenuLocations menuLocation, nfloat gestureActiveArea) { _panOriginX = ContentViewController.View.Frame.X; _ignorePan = PanGestureInActiveArea(panGesture, menuLocation, gestureActiveArea); }