protected override void SelectStyleCore(CalendarCellStyleContext context, Telerik.UI.Xaml.Controls.Input.RadCalendar container) { var events = (container.DataContext as ViewModelCalendarEvents).Events; if (events.Where(e => e.Date == context.Date).Count() > 0) { context.CellTemplate = this.EventTemplate; } }
internal void Invalidate(MultiDayViewUpdateFlag flag) { RadCalendar calendar = this.owner; if (calendar != null && calendar.IsTemplateApplied && calendar.Model.IsTreeLoaded) { if (calendar.IsLoaded) { CalendarMultiDayViewModel multiDayViewModel = this.owner.Model.multiDayViewModel; if (flag == MultiDayViewUpdateFlag.All) { multiDayViewModel.CalendarCells?.Clear(); multiDayViewModel.CalendarHeaderCells?.Clear(); multiDayViewModel.CalendarDecorations?.Clear(); multiDayViewModel.allDayAppointmentInfos?.Clear(); multiDayViewModel.appointmentInfos?.Clear(); calendar.allDayAreaLayer?.ClearRealizedAppointmentVisuals(); calendar.timeRulerLayer?.ClearRealizedAppointmentVisuals(); calendar.contentLayer?.RecycleAllVisuals(); } if (flag == MultiDayViewUpdateFlag.AffectsTimeRuler) { this.RecycleTimeRulerVisuals(); multiDayViewModel.timeRulerItems?.Clear(); multiDayViewModel.timerRulerLines?.Clear(); multiDayViewModel.appointmentInfos?.Clear(); } if (flag == MultiDayViewUpdateFlag.AffectsAppointments) { multiDayViewModel.appointmentInfos?.Clear(); multiDayViewModel.allDayAppointmentInfos?.Clear(); calendar.allDayAreaLayer?.ClearRealizedAppointmentVisuals(); calendar.timeRulerLayer?.ClearRealizedAppointmentVisuals(); } if (flag == MultiDayViewUpdateFlag.AffectsSpecialSlots) { multiDayViewModel.specialSlots?.Clear(); calendar.timeRulerLayer?.ClearRealizedSlotVisuals(); } calendar.Model.multiDayViewModel.updateFlag = flag; calendar.timeRulerLayer.shouldArrange = true; calendar.allDayAreaLayer.shouldArrange = true; } calendar.Invalidate(); } }
internal void DetachEvents() { this.owner = null; if (this.timer != null) { this.timer.Tick -= this.TimerCallback; } this.specialSlotsCollectionChangedListener?.Detach(); if (this.specialSlotsPropertyChangedListeners != null && this.specialSlotsPropertyChangedListeners.Count > 0) { foreach (WeakPropertyChangedListener weakPropertyChangedListener in this.specialSlotsPropertyChangedListeners) { weakPropertyChangedListener.Detach(); } } }
private void UpdateAppearance(MultiDayViewUpdateFlag flag) { RadCalendar calendar = this.owner; if (calendar != null && calendar.IsTemplateApplied && calendar.Model.IsTreeLoaded) { if (calendar.IsLoaded) { if (flag == MultiDayViewUpdateFlag.AffectsAppointments) { XamlAllDayAreaLayer allDayArea = this.owner.allDayAreaLayer; allDayArea.UpdatePanelBackground(this.AllDayAreaBackground); } if (flag == MultiDayViewUpdateFlag.AffectsTimeRuler) { XamlMultiDayViewLayer timeRulerArea = this.owner.timeRulerLayer; timeRulerArea.UpdatePanelsBackground(this.TimelineBackground); } } } }
internal CalendarDateRangeCollection(RadCalendar owner) { this.owner = owner; this.dateRangesList = new List <CalendarDateRange>(); }