Exemplo n.º 1
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     ShowDatesinListView.Hidden = true;
     // Perform any additional setup after loading the view, typically from a nib.
     monthView = MonthView.InitializeCalendar(DateTime.Now);
     monthView.CreateCalendar();
     monthView.Frame = new CoreGraphics.CGRect(0, 0, CalendarView.Frame.Width, CalendarView.Frame.Height);
     CalendarView.AddSubview(monthView);
     SetUpFirstDatePicker();
     SetUpEndDatePicker();
     DatePickerStart.Text              = DateTime.Now.ToString("dd MMMMM yyyy dddd");
     DatePickerEnd.Text                = DateTime.Now.ToString("dd MMMMM yyyy dddd");
     EnableRangePickers.TouchUpInside += (object sender, EventArgs e) =>
     {
         if (rangesEnabled == false)
         {
             RangeModel range = new RangeModel()
             {
                 startDate = startDate, endDate = endDate
             };
             monthView.CreateCalendarForRange(range);
             EnableRangePickers.SetTitle("Disable RangePickers", UIControlState.Normal);
             rangesEnabled = true;
             ShowDatesinListView.Hidden = false;
         }
         else
         {
             monthView.ChangeDate(startDate);
             EnableRangePickers.SetTitle("Enable RangePickers", UIControlState.Normal);
             rangesEnabled = false;
             ShowDatesinListView.Hidden = true;
         }
     };
 }
        void ReleaseDesignerOutlets()
        {
            if (CalendarView != null)
            {
                CalendarView.Dispose();
                CalendarView = null;
            }

            if (DatePickerEnd != null)
            {
                DatePickerEnd.Dispose();
                DatePickerEnd = null;
            }

            if (DatePickerStart != null)
            {
                DatePickerStart.Dispose();
                DatePickerStart = null;
            }

            if (EnableRangePickers != null)
            {
                EnableRangePickers.Dispose();
                EnableRangePickers = null;
            }

            if (ShowDatesinListView != null)
            {
                ShowDatesinListView.Dispose();
                ShowDatesinListView = null;
            }
        }