Esempio n. 1
0
        private void ApplyTimeRulerStyle(object item, FrameworkElement container)
        {
            MultiDayViewSettings settings = this.Owner.MultiDayViewSettings;
            CalendarTimeRulerItemStyleSelector itemStyleSelector = settings.TimeRulerItemStyleSelector ?? settings.defaultTimeRulerItemStyleSelector;

            if (itemStyleSelector != null)
            {
                var style = itemStyleSelector.SelectStyle(item, container);
                if (style != null)
                {
                    container.Style = style;
                }
            }
        }
Esempio n. 2
0
        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);
            }
        }