From 8c2906c01e9fef3ad01f5686862b413c0b43e087 Mon Sep 17 00:00:00 2001 From: Jessica <33695848+jessicarich1980@users.noreply.github.com> Date: Wed, 15 Nov 2017 14:57:39 -0600 Subject: [PATCH] adding support for OnMenuToggle and IsMenuShown Added support for when the menu is shown or hidden it would raise event New event: OnMenuToggle > this event is raised when the menu is hidden or shown New property: IsMenuShown > this is a property that is accurate of whether the menu is shown or hidden --- SlideOverKit/Gestures/VerticalGestures.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/SlideOverKit/Gestures/VerticalGestures.cs b/SlideOverKit/Gestures/VerticalGestures.cs index dab1b83..920845f 100644 --- a/SlideOverKit/Gestures/VerticalGestures.cs +++ b/SlideOverKit/Gestures/VerticalGestures.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace SlideOverKit { @@ -6,15 +6,19 @@ internal class VerticalGesture : GestureBase, IDragGesture, IDisposable { double _topMax, _topMin, _bottomMax, _bottomMin = 0; bool _isToptoBottom = true; - + SlideMenuView _view; + public VerticalGesture (SlideMenuView view, double density) : base (view, density) { - CheckViewBound (view); - UpdateLayoutSize (view); - view.HideEvent = LayoutHideStatus; + _view = view; + CheckViewBound (_view); + UpdateLayoutSize (_view); + _view.HideEvent = LayoutHideStatus; } - void CheckViewBound (SlideMenuView view) + + + void CheckViewBound (SlideMenuView view) { if (ScreenSizeHelper.ScreenHeight == 0 || ScreenSizeHelper.ScreenWidth == 0) throw new Exception ("Please set ScreenSizeHelper.ScreenHeight or ScreenSizeHelper.ScreenWidth"); @@ -106,6 +110,7 @@ public void DragFinished () public void LayoutShowStatus () { + _view.IsMenuShown = true; if (RequestLayout != null) { GetShowPosition (); RequestLayout (_left, _top, _right, _bottom, _density); @@ -116,6 +121,7 @@ public void LayoutShowStatus () public void LayoutHideStatus () { + _view.IsMenuShown = false; if (RequestLayout != null) { GetHidePosition (); RequestLayout (_left, _top, _right, _bottom, _density);