CalendarSample.CustomSelectionController.ViewDidLoad C# (CSharp) Метод

ViewDidLoad() публичный Метод

public ViewDidLoad ( ) : void
Результат void
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			calendar.MaxSelectionCount = 100;
			calendar.SelectionChanging += (object sender, Xuni.iOS.Calendar.SelectionChangingEventArgs e) => {
				NSDateComponents components = new NSDateComponents();
				components.Day = 1;

				for(NSDate date = e.SelectedDates.StartDate;
					date.Compare(e.SelectedDates.EndDate) == NSComparisonResult.Ascending || 
					date.Compare(e.SelectedDates.EndDate) == NSComparisonResult.Same;
					date = NSCalendar.CurrentCalendar.DateByAddingComponents(components, date, NSCalendarOptions.None))
				{
					nint weekday = NSCalendar.CurrentCalendar.Components(NSCalendarUnit.Weekday, date).Weekday;

					if (weekday == 1 || weekday == 7) {
						e.SelectedDates.AddExcludedDates(date);
					}
				}
			};
		}
	}