Exemplo n.º 1
0
        private void UpdateCalendarHeaderCellDecorations()
        {
            if (this.Owner.Model.CalendarHeaderCells == null)
            {
                return;
            }

            foreach (CalendarHeaderCellModel cell in this.Owner.Model.CalendarHeaderCells)
            {
                if (!cell.layoutSlot.IsSizeValid() || !ShouldRenderPrimaryCellDecorationVisual(cell))
                {
                    continue;
                }

                Border element = this.GetCalendarDecorationVisual(cell, CalendarDecorationType.Cell);
                if (element != null)
                {
                    RadRect decorationSlot = cell.layoutSlot;
                    decorationSlot = this.InflateCellDecorationHorizontally(decorationSlot, element);
                    decorationSlot = this.InflateCellDecorationVertically(decorationSlot, element);

                    CalendarLayer.ArrangeUIElement(element, decorationSlot);
                }
            }
        }
Exemplo n.º 2
0
        private void UpdateCalendarHeaderGridLineDecorations()
        {
            if (this.Owner.Model.CalendarHeaderCells == null)
            {
                this.dayNamesLineSlot    = RadRect.Empty;
                this.weekNumbersLineSlot = RadRect.Empty;

                return;
            }

            if (this.Owner.DayNamesVisibility == Visibility.Visible)
            {
                Border dayNamesBottomDecorationLine = this.GetCalendarDecorationVisual(this.dayNamesLineModel, CalendarDecorationType.GridLine);
                if (dayNamesBottomDecorationLine != null)
                {
                    CalendarHeaderCellModel dayNameCell = this.GetFirstDayNameCell();
                    this.dayNamesLineSlot = new RadRect(0d, dayNameCell.LayoutSlot.Bottom - this.Owner.GridLinesThickness, this.Owner.CalendarViewSize.Width, this.Owner.GridLinesThickness);
                    CalendarLayer.ArrangeUIElement(dayNamesBottomDecorationLine, this.dayNamesLineSlot);
                    Canvas.SetZIndex(dayNamesBottomDecorationLine, DefaultGridLineDecorationZIndex);
                }
            }
            else
            {
                this.dayNamesLineSlot = RadRect.Empty;
            }

            if (this.Owner.WeekNumbersVisibility == Visibility.Visible)
            {
                Border weekNumbersRightDecorationLine = this.GetCalendarDecorationVisual(this.weekNumbersLineModel, CalendarDecorationType.GridLine);
                if (weekNumbersRightDecorationLine != null)
                {
                    CalendarHeaderCellModel weekNumberCell = this.GetFirstWeekNumberCell();
                    this.weekNumbersLineSlot = new RadRect(weekNumberCell.LayoutSlot.Right - this.Owner.GridLinesThickness, 0d, this.Owner.GridLinesThickness, this.Owner.CalendarViewSize.Height);
                    CalendarLayer.ArrangeUIElement(weekNumbersRightDecorationLine, this.weekNumbersLineSlot);
                    Canvas.SetZIndex(weekNumbersRightDecorationLine, DefaultGridLineDecorationZIndex);
                }
            }
            else
            {
                this.weekNumbersLineSlot = RadRect.Empty;
            }
        }