Beispiel #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var dataSource = CreateSchedule();

            _source = (WorkTimeCalendarCollectionSource)workTimeCollection.Source;
            _source.CalendarModel.Items = dataSource;
            workTimeCollection.Source   = _source;

            _dropDowns = new List <EOSSandboxDropDown>()
            {
                themesDropDown,
                titleFontDropDown,
                titleSizeDropDown,
                dayFontDropDown,
                dayTextSizeDropDown,
                dayTextColorDropDown,
                currentDayBackgroundColorDropDown,
                currentDayTextColorDropDown,
                weekStartDropdown,
                dayEvenBackgroundColor,
                devidersColor,
                currentDayDevidersColor,
                titleColorDropDown
            };

            View.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                _dropDowns.ForEach(dropDown => dropDown.CloseInputControl());
            }));

            var rect = new CGRect(0, 0, 100, 100);

            InitThemeDropDown(rect);
            themesDropDown.SetTextFieldText(_source.CalendarModel.GetThemeProvider().GetCurrentTheme() is LightEOSTheme ? "Light" : "Dark");
            InitSources(rect);
            InitWeekStartDropDown(rect);
            resetButton.TouchUpInside += (sender, e) =>
            {
                _dropDowns.Except(new[] { themesDropDown }).ToList().ForEach(dropDown => dropDown.ResetValue());
                _source.CalendarModel.ResetCustomization();
            };
        }
 private void Initalize()
 {
     Source          = new WorkTimeCalendarCollectionSource(this);
     BackgroundColor = UIColor.Clear;
 }