private void LayoutLowerAllDayAreaHorizontalBorder(CalendarGridLine horizontalAllDayLowerLine) { MultiDayViewSettings settings = this.Owner.MultiDayViewSettings; Style allDayAreaBorderStyle = settings.AllDayAreaBorderStyle ?? settings.defaultAllDayAreaBorderStyle; if (allDayAreaBorderStyle != null) { this.horizontalLowerGridLineBorder.Style = allDayAreaBorderStyle; } if (!XamlDecorationLayer.IsStrokeBrushExplicitlySet(this.horizontalLowerGridLineBorder.Style)) { this.horizontalLowerGridLineBorder.BorderBrush = this.Owner.GridLinesBrush; } if (this.horizontalLowerGridLineBorder.BorderBrush != null && !XamlDecorationLayer.IsStrokeThicknessExplicitlySet(this.horizontalLowerGridLineBorder.Style)) { this.horizontalLowerGridLineBorder.BorderThickness = new Thickness(this.Owner.GridLinesThickness); } RadRect layoutSlot = horizontalAllDayLowerLine.layoutSlot; layoutSlot.Height = this.horizontalLowerGridLineBorder.BorderThickness.Left; XamlMultiDayViewLayer.ArrangeUIElement(this.horizontalLowerGridLineBorder, layoutSlot, true); }
private void ArrangeCellDecoration(Border element, RadRect layoutSlot, int zIndex) { if (element != null) { RadRect decorationSlot = layoutSlot; decorationSlot = this.InflateCellDecorationHorizontally(decorationSlot, element); decorationSlot = this.InflateCellDecorationVertically(decorationSlot, element); XamlDecorationLayer.ArrangeUIElement(element, decorationSlot); Canvas.SetZIndex(element, zIndex); } }
private void RecycleVisuals(IEnumerable <CalendarCellModel> cellsToUpdate) { foreach (CalendarCellModel cell in cellsToUpdate) { this.RecyclePrimaryVisual(cell); if (this.currentCellDecorationVisual != null && this.currentCellDecorationVisual.Tag == cell) { XamlDecorationLayer.RecycleAdditionalVisual(this.currentCellDecorationVisual); } if (this.pointerOverCellDecorationVisual != null && this.pointerOverCellDecorationVisual.Tag == cell) { XamlDecorationLayer.RecycleAdditionalVisual(this.pointerOverCellDecorationVisual); } } }
private void UpdateCalendarGridLineDecorations() { foreach (CalendarGridLine gridLine in this.Owner.Model.CalendarDecorations) { if (!gridLine.layoutSlot.IsSizeValid()) { continue; } FrameworkElement element = this.GetCalendarDecorationVisual(gridLine, CalendarDecorationType.GridLine); if (element != null) { XamlDecorationLayer.ArrangeUIElement(element, gridLine.layoutSlot); Canvas.SetZIndex(element, DefaultGridLineDecorationZIndex); } } }
private void PrepareDecorationVisual(Border visual, CalendarNode node, CalendarDecorationType decorationType) { visual.Tag = node; if (decorationType == CalendarDecorationType.GridLine) { RadCalendar calendar = this.Owner; if (calendar.DisplayMode == CalendarDisplayMode.MultiDayView) { MultiDayViewSettings settings = calendar.MultiDayViewSettings; CalendarTimeRulerItemStyleSelector styleSelector = settings.TimeRulerItemStyleSelector ?? settings.defaultTimeRulerItemStyleSelector; if (styleSelector != null) { Style style = styleSelector.SelectStyle(node, visual); if (style != null) { visual.Style = style; if (!XamlDecorationLayer.IsStrokeBrushExplicitlySet(visual.Style)) { visual.BorderBrush = this.Owner.GridLinesBrush; } if (visual.BorderBrush != null && !XamlDecorationLayer.IsStrokeThicknessExplicitlySet(visual.Style)) { visual.BorderThickness = new Thickness(this.Owner.GridLinesThickness); } } else { visual.BorderBrush = this.Owner.GridLinesBrush; visual.BorderThickness = new Thickness(this.Owner.GridLinesThickness); } } } else { visual.BorderBrush = this.Owner.GridLinesBrush; visual.BorderThickness = new Thickness(this.Owner.GridLinesThickness); } } else { this.ApplyStyleToCellDecorationVisual(visual, node); } }
private void LayoutTopAllDayAreaHorizontalBorder(CalendarGridLine horizontalAllDayUpperLine) { this.ApplyTimeRulerStyle(horizontalAllDayUpperLine, this.horizontaUpperGridLineBorder); if (!XamlDecorationLayer.IsStrokeBrushExplicitlySet(this.horizontaUpperGridLineBorder.Style)) { this.horizontaUpperGridLineBorder.BorderBrush = this.Owner.GridLinesBrush; } if (this.horizontaUpperGridLineBorder.BorderBrush != null && !XamlDecorationLayer.IsStrokeThicknessExplicitlySet(this.horizontaUpperGridLineBorder.Style)) { this.horizontaUpperGridLineBorder.BorderThickness = new Thickness(this.Owner.GridLinesThickness); } RadRect layoutSlot = horizontalAllDayUpperLine.layoutSlot; XamlMultiDayViewLayer.ArrangeUIElement(this.horizontaUpperGridLineBorder, layoutSlot, true); }
private void LayoutVerticalHeaderBorder(CalendarGridLine verticalLine) { this.ApplyTimeRulerStyle(verticalLine, this.verticalGridLineBorder); if (!XamlDecorationLayer.IsStrokeBrushExplicitlySet(this.verticalGridLineBorder.Style)) { this.verticalGridLineBorder.BorderBrush = this.Owner.GridLinesBrush; } if (this.verticalGridLineBorder.BorderBrush != null && !XamlDecorationLayer.IsStrokeThicknessExplicitlySet(this.verticalGridLineBorder.Style)) { this.verticalGridLineBorder.BorderThickness = new Thickness(this.Owner.GridLinesThickness); } RadRect layoutSlot = verticalLine.layoutSlot; XamlMultiDayViewLayer.ArrangeUIElement(this.verticalGridLineBorder, layoutSlot, true); }
private void RecycleAllVisuals() { foreach (Border visual in this.realizedCalendarCellDecorationPresenters.Values) { this.RecyclePrimaryVisual(visual); } this.realizedCalendarCellDecorationPresenters.Clear(); if (this.currentCellDecorationVisual != null && this.currentCellDecorationVisual.Tag != null) { XamlDecorationLayer.RecycleAdditionalVisual(this.currentCellDecorationVisual); } if (this.pointerOverCellDecorationVisual != null && this.pointerOverCellDecorationVisual.Tag != null) { XamlDecorationLayer.RecycleAdditionalVisual(this.pointerOverCellDecorationVisual); } }
private void UpdateTimerRulerLines(ElementCollection <CalendarGridLine> timeRulerLines) { this.RecycleTimeRulerLines(timeRulerLines); foreach (var gridLine in timeRulerLines) { if (!this.viewPortArea.IntersectsWith(gridLine.layoutSlot)) { continue; } Border border = this.GetTimerRulerLine(gridLine); if (border != null) { this.ApplyTimeRulerStyle(gridLine, border); if (!XamlDecorationLayer.IsStrokeBrushExplicitlySet(border.Style)) { border.BorderBrush = this.Owner.GridLinesBrush; } if (border.BorderBrush != null && !XamlDecorationLayer.IsStrokeThicknessExplicitlySet(border.Style)) { border.BorderThickness = new Thickness(this.Owner.GridLinesThickness); } RadRect layoutSlot = gridLine.layoutSlot; XamlContentLayer.ArrangeUIElement(border, layoutSlot, true); Canvas.SetLeft(border, -this.leftOffset); Canvas.SetZIndex(border, XamlMultiDayViewLayer.DefaultLineZIndex); } } foreach (var recycledLine in this.recycledTimeRulerLines) { recycledLine.Visibility = Visibility.Collapsed; } }