public override void OnViewModelLoadedOverride()
        {
            ViewModel.PropertyChanged += new WeakEventHandler <PropertyChangedEventArgs>(ViewModel_PropertyChanged).Handler;

            _calendarView         = FindViewById <MyCalendarView>(Resource.Id.CalendarView);
            _calendarView.Adapter = new MyCalendarAdapter(ViewModel, ViewModel.DisplayMonth, ViewModel.FirstDayOfWeek);
            _calendarView_DisplayMonthChanged(_calendarView, new EventArgs());
            _calendarView.DisplayMonthChanged += _calendarView_DisplayMonthChanged;
            _calendarView.SelectedDateChanged += _calendarView_SelectedDateChanged;
            _calendarView.SelectedDate         = ViewModel.SelectedDate;

            var addItemControl = FindViewById <FloatingAddItemControl>(Resource.Id.FloatingAddItemControl);

            addItemControl.SupportsAddHoliday    = true;
            addItemControl.OnRequestAddExam     += AddItemControl_OnRequestAddExam;
            addItemControl.OnRequestAddHomework += AddItemControl_OnRequestAddHomework;
            addItemControl.OnRequestAddHoliday  += AddItemControl_OnRequestAddHoliday;

            _dayPagerControl = FindViewById <DayPagerControl>(Resource.Id.DayPagerControl);
            _dayPagerControl.Initialize(ViewModel.SemesterItemsViewGroup, ViewModel.SelectedDate);
            _dayPagerControl.ItemClick          += _dayPagerControl_ItemClick;
            _dayPagerControl.HolidayItemClick   += _dayPagerControl_HolidayItemClick;
            _dayPagerControl.ScheduleItemClick  += _dayPagerControl_ScheduleItemClick;
            _dayPagerControl.ScheduleClick      += _dayPagerControl_ScheduleClick;
            _dayPagerControl.CurrentDateChanged += _dayPagerControl_CurrentDateChanged;
        }
Beispiel #2
0
 private void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     switch (e.PropertyName)
     {
     case nameof(ViewModel.CurrentDate):
         if (_dayPagerControl.CurrentDate != ViewModel.CurrentDate)
         {
             _dayPagerControl.Initialize(ViewModel.SemesterItemsViewGroup, ViewModel.CurrentDate);
         }
         break;
     }
 }
Beispiel #3
0
        public override void OnViewModelLoadedOverride()
        {
            ViewModel.PropertyChanged += new WeakEventHandler <PropertyChangedEventArgs>(ViewModel_PropertyChanged).Handler;

            var addItemControl = FindViewById <FloatingAddItemControl>(Resource.Id.FloatingAddItemControl);

            addItemControl.OnRequestAddEvent += AddItemControl_OnRequestAddEvent;
            addItemControl.OnRequestAddTask  += AddItemControl_OnRequestAddTask;

            _dayPagerControl = FindViewById <DayPagerControl>(Resource.Id.DayPagerControl);
            _dayPagerControl.CurrentDateChanged += _dayPagerControl_CurrentDateChanged;
            _dayPagerControl.Initialize(ViewModel.SemesterItemsViewGroup, ViewModel.CurrentDate);
            _dayPagerControl.ItemClick         += _dayPagerControl_ItemClick;
            _dayPagerControl.HolidayItemClick  += _dayPagerControl_HolidayItemClick;
            _dayPagerControl.ScheduleItemClick += _dayPagerControl_ScheduleItemClick;
            _dayPagerControl.ScheduleClick     += _dayPagerControl_ScheduleClick;
        }