private async void CreateScheduleView(int index, Entities.Scheduler scheduler = null) { DayConfigControl Schedule_UI = new DayConfigControl(inputDate(), Navigation, this, true, scheduleList, scheduler); Schedule_UI.indexText = (index).ToString(); Schedule_UI.editText = "edit"; Schedule_UI.ScheduleReceived += ReceiveEditedORNewschedule; Schedule_UI.DefaultUI = UIEnum.Schedul_NormalView; Schedule_UI.DeleteDelegate += SingleDeleteDelegate; ScheduleView.Children.Insert(index - 1, Schedule_UI); TapGestureRecognizer gestureRecognizer = new TapGestureRecognizer(); gestureRecognizer.Tapped += GestureRecognizer_Tapped; Schedule_UI.GestureRecognizers.Add(gestureRecognizer); if (scheduler == null) { scheduler = new Scheduler(); scheduler.index = index.ToString(); scheduleList.scheduler.Add(scheduler); await Navigation.PushAsync(new ConfigurationSettingPage(inputDate(), this, Schedule_UI.indexText, Schedule_UI.SelectedStartTime, Schedule_UI.SelectedStopTime, "5", true, scheduleList)); } else { scheduleList.scheduler.Add(scheduler); } }
public DayConfigControl(List <UIDay> _uIDays, INavigation navigation, IScheduleOperation scheduleOperation, bool _isActive, Schedules schedules, Entities.Scheduler scheduler = null) { InitializeComponent(); this.uIDays = _uIDays; IntervalList = BuildIntervalList(); if (scheduler != null) { SetIntervalValue(scheduler); SetStartAndStopValue(scheduler); SetDaysValue(scheduler); SetInterval(); SetActiveStatusValue(scheduler); } this.scheduleOperation = scheduleOperation; weekControl = new WeekControl(weekFrameLayout); weekControl.DaysList = this.uIDays; weekFrameLayout.Children.Add(weekControl); WeekCardControl weekCardControl = new WeekCardControl(); weekCardControl.DaysList = this.uIDays; weekexpand.Children.Add(weekCardControl); rawSchedules = schedules; this.navigation = navigation; BindingContext = this; if (scheduler == null) { isActive = _isActive; toggle.IsToggled = _isActive; } toggle.Toggled += Toggle_Toggled; }
private void AddSchedule(Entities.Scheduler scheduler = null) { CreateScheduleView(GetScheduleNewIndex(), scheduler); }