Exemple #1
0
        //void calItem_OnClicked(object sender, EventArgs e)
        //{
        //    if (OnItemSelected != null)
        //        OnItemSelected(this, new ItemSelectedEventArgs((sender as MainCalendarViewItem).Item));
        //}

        protected override TCalendarGrid GenerateCalendarGrid(DateTime displayMonth)
        {
            var grid = new MainCalendarGrid(this, displayMonth, IsMouseOver, ViewModel.SemesterItemsViewGroup.Items, ViewModel);

            grid.OnRequestChangeItemDate += Grid_OnRequestChangeItemDate;
            return(grid);
        }
        public MainCalendarSquare(MainCalendarGrid calendarGrid, DateTime date, MyObservableList<BaseViewItemHomeworkExamGrade> allItems) : base(calendarGrid, date)
        {
            // Render is called before this

            AllowDrop = true;
            DragOver += MainCalendarSquare_DragOver;
            Drop += MainCalendarSquare_Drop;
            _itemsControl.ItemsSource = HomeworksOnDay.Get(allItems, date);
            _holidays = HolidaysOnDay.Create(allItems, date);
            _holidays.CollectionChanged += new WeakEventHandler<NotifyCollectionChangedEventArgs>(delegate { UpdateIsHoliday(); }).Handler;
            UpdateIsHoliday();
        }
Exemple #3
0
        public MainCalendarSquare(MainCalendarGrid calendarGrid, DateTime date, MyObservableList <BaseViewItemHomeworkExamGrade> allItems) : base(calendarGrid, date)
        {
            // Render is called before this

            _calendarViewModel = calendarGrid.ViewModel;
            _allItems          = allItems;
            AllowDrop          = true;
            DragOver          += MainCalendarSquare_DragOver;
            Drop += MainCalendarSquare_Drop;
            _calendarViewModel.PropertyChanged += new WeakEventHandler <PropertyChangedEventArgs>(_calendarViewModel_PropertyChanged).Handler;
            UpdateItemsSource();
            _holidays = HolidaysOnDay.Create(allItems, date);
            _holidays.CollectionChanged += new WeakEventHandler <NotifyCollectionChangedEventArgs>(delegate { UpdateIsHoliday(); }).Handler;
            UpdateIsHoliday();
        }