/// <summary>
        ///     Hides the panel.
        /// </summary>
        /// <param name="container">Container.</param>
        public void HidePanel(PanelContainer container)
        {
            container.ViewWillDisappear(true);

            UIView.Animate(AnimationSpeed, 0, UIViewAnimationOptions.CurveEaseInOut,
                delegate { View.Frame = container.GetTopViewPositionWhenSliderIsHidden(View.Frame); },
                delegate
                {
                    View.RemoveGestureRecognizer(_tapToClose);
                    container.Hide();
                    container.ViewDidDisappear(true);
                });
        }
        /// <summary>
        ///     Shows the panel.
        /// </summary>
        /// <param name="container">Container.</param>
        public void ShowPanel(PanelContainer container)
        {
            container.ViewWillAppear(true);
            container.Show();

            UIView.Animate(AnimationSpeed, 0, UIViewAnimationOptions.CurveEaseInOut,
                delegate { View.Frame = container.GetTopViewPositionWhenSliderIsVisible(View.Frame); },
                delegate
                {
                    View.AddGestureRecognizer(_tapToClose);
                    container.ViewDidAppear(true);
                });
        }
 /// <summary>
 ///     Removes the panel.
 /// </summary>
 /// <param name="container">Container.</param>
 public void RemovePanel(PanelContainer container)
 {
     container.View.RemoveFromSuperview();
     container.RemoveFromParentViewController();
     _panelContainers.Remove(container);
 }
        /// <summary>
        ///     Insert a panel in the view hierarchy.  If this is done early in
        ///     the creation process,  we postponed adding  until later, at one
        ///     point we are guarantee that Superview is not null.
        /// </summary>
        /// <param name="container">Container.</param>
        public void InsertPanel(PanelContainer container)
        {
            _panelContainers.Add(container);

            if (!_firstTime)
            {
                UIView parent = View.Superview;
                View.Superview.AddSubview(container.View);
                View.Superview.AddGestureRecognizer(_slidingGesture);
                View.RemoveFromSuperview();
                parent.AddSubview(View);
            }
        }
		/// <summary>
		/// Initializes a new instance of the <see cref="SlidingPanels.Lib.SlidingGestureEventArgs"/> class.
		/// </summary>
		/// <param name="panelContainer">Panel container.</param>
		public SlidingGestureEventArgs(PanelContainer panelContainer)
		{
			PanelContainer = panelContainer;
		}