escoz.CalendarMonthView.CalendarMonthView C# (CSharp) Method

CalendarMonthView() public method

public CalendarMonthView ( System.DateTime selectedDate, bool showHeader, float width = 320 ) : System
selectedDate System.DateTime
showHeader bool
width float
return System
		public CalendarMonthView(DateTime selectedDate, bool showHeader, float width = 320) 
		{
			_showHeader = showHeader;

			if (_showHeader)
				headerHeight = 20;

			if (_showHeader)
				this.Frame = new RectangleF(0, 0, width, 218);
			else 
				this.Frame = new RectangleF(0, 0, width, 198);
				
			BoxWidth = Convert.ToInt32(Math.Ceiling( width / 7 ));

			BackgroundColor = UIColor.White;

			ClipsToBounds = true;

			CurrentSelectedDate = selectedDate;
			CurrentDate = DateTime.Now.Date;
			CurrentMonthYear = new DateTime(CurrentSelectedDate.Year, CurrentSelectedDate.Month, 1);

			var swipeLeft = new UISwipeGestureRecognizer(p_monthViewSwipedLeft);
			swipeLeft.Direction = UISwipeGestureRecognizerDirection.Left;
			this.AddGestureRecognizer(swipeLeft);

			var swipeRight = new UISwipeGestureRecognizer(p_monthViewSwipedRight);
			swipeRight.Direction = UISwipeGestureRecognizerDirection.Right;
			this.AddGestureRecognizer(swipeRight);

			var swipeUp = new UISwipeGestureRecognizer(p_monthViewSwipedUp);
			swipeUp.Direction = UISwipeGestureRecognizerDirection.Up;
			this.AddGestureRecognizer(swipeUp);
		}