Esempio n. 1
0
        /// <summary>
        ///     Called when the view is first loaded
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _panelContainers = new List <PanelContainer>();

            _tapToClose = new UITapGestureRecognizer();
            _tapToClose.AddTarget(() => HidePanel(CurrentActivePanelContainer));

            _slidingGesture = new SlidingGestureRecogniser(_panelContainers, ShouldReceiveTouch, this, View);

            _slidingGesture.ShowPanel += (sender, e) => ShowPanel(((SlidingGestureEventArgs)e).PanelContainer);

            _slidingGesture.HidePanel += (sender, e) => HidePanel(((SlidingGestureEventArgs)e).PanelContainer);

            View.ClipsToBounds       = true;
            View.Layer.ShadowColor   = ShadowColor;
            View.Layer.MasksToBounds = false;
            View.Layer.ShadowOpacity = ShadowOpacity;

            CGRect shadow = View.Bounds;

            shadow.Inflate(new CGSize(3, 3));
            View.Layer.ShadowPath = UIBezierPath.FromRoundedRect(shadow, 0).CGPath;
        }
		/// <summary>
		/// Called when the view is first loaded
		/// </summary>
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			_panelContainers = new List<PanelContainer> ();

			//TODO: We should expose these as properties of the sliding panel controller
			View.Layer.ShadowRadius = 5;
			View.Layer.ShadowColor = UIColor.Black.CGColor;
			View.Layer.ShadowOpacity = .75f;
		
			_tapToClose = new UITapGestureRecognizer();
			_tapToClose.AddTarget(() => { 
				HidePanel (CurrentActivePanelContainer); }
			);

			_slidingGesture = new SlidingGestureRecogniser (_panelContainers, ShouldReceiveTouch, this);

			_slidingGesture.ShowPanel += (object sender, EventArgs e) => {
				ShowPanel(((SlidingGestureEventArgs)e).PanelContainer);
			};

			_slidingGesture.HidePanel += (object sender, EventArgs e) => {
				HidePanel(((SlidingGestureEventArgs)e).PanelContainer);
			};
		}
        /// <summary>
        ///     Called when the view is first loaded
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _panelContainers = new List<PanelContainer>();

            _tapToClose = new UITapGestureRecognizer();
            _tapToClose.AddTarget(() => HidePanel(CurrentActivePanelContainer));

            _slidingGesture = new SlidingGestureRecogniser(_panelContainers, ShouldReceiveTouch, this);

            _slidingGesture.ShowPanel += (sender, e) => ShowPanel(((SlidingGestureEventArgs) e).PanelContainer);

            _slidingGesture.HidePanel += (sender, e) => HidePanel(((SlidingGestureEventArgs) e).PanelContainer);
        }
        /// <summary>
        ///     Called when the view is first loaded
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _panelContainers = new List<PanelContainer>();

            _tapToClose = new UITapGestureRecognizer();
            _tapToClose.AddTarget(() => HidePanel(CurrentActivePanelContainer));

            _slidingGesture = new SlidingGestureRecogniser(_panelContainers, ShouldReceiveTouch, this, View);

            _slidingGesture.ShowPanel += (sender, e) => ShowPanel(((SlidingGestureEventArgs)e).PanelContainer);

            _slidingGesture.HidePanel += (sender, e) => HidePanel(((SlidingGestureEventArgs)e).PanelContainer);

            View.ClipsToBounds = true;
            View.Layer.ShadowColor = ShadowColor;
            View.Layer.MasksToBounds = false;
            View.Layer.ShadowOpacity = ShadowOpacity;

            var shadow = View.Bounds;
            shadow.Inflate(new SizeF(3, 3));
            View.Layer.ShadowPath = UIBezierPath.FromRoundedRect(shadow, 0).CGPath;
        }