Hi,
I have a month view that is a bit retemplated.
First I have stretched the "GoToDay" button to fill the whole MonthViewItem lite this:
That made my colored special slots for saturdays and sundays not fill the whole area.
I got a tip from you to change the margin of my customized special slots like this:
That made the slots fill the whole area fine, but then I got this strange behavior on mondays.
See attached images.
On mondays the orange color from "Today" is spread across the whole week as you can see.
Any other day of week it looks fine. For the second image, "correct tuesday.png" I just changed the date on my computer and reloaded the page.
I have now removed the special slots, but its still the same error. So I start to think that I have made another change that caused this, but I can't find out what.
Do you have any ideas?
Regards,
HÃ¥kan
I have a month view that is a bit retemplated.
First I have stretched the "GoToDay" button to fill the whole MonthViewItem lite this:
<
Style
x:Key
=
"TimeRulerMonthViewItemStyle"
TargetType
=
"local:TimeRulerMonthViewItem"
>
<
Setter
Property
=
"Foreground"
Value
=
"{StaticResource MonthViewTimeRulerItemForeground_Normal}"
/>
<
Setter
Property
=
"Margin"
Value
=
"0 -1 -1 1"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"local:TimeRulerMonthViewItem"
>
<
Grid
>
<
telerik:RadButton
VerticalAlignment
=
"Stretch"
Padding
=
"0"
Style
=
"{StaticResource GoToDayButtonStyle}"
Command
=
"local:RadScheduleViewCommands.SetDayViewMode"
CommandParameter
=
"{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.DateTime.Date}"
>
<
StackPanel
Orientation
=
"Vertical"
VerticalAlignment
=
"Center"
IsHitTestVisible
=
"False"
>
<
TextBlock
Text
=
"{Binding Content.DateTime.Day, RelativeSource={RelativeSource TemplatedParent}}"
Foreground
=
"{StaticResource TextBrush}"
Opacity
=
"0.75"
HorizontalAlignment
=
"Center"
FontSize
=
"24"
/>
<
TextBlock
Text
=
"{Binding Content.DateTime, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DateTimeConverter}, ConverterParameter='MMMM'}"
Foreground
=
"{StaticResource TextBrush}"
Opacity
=
"0.75"
HorizontalAlignment
=
"Center"
FontSize
=
"10"
Margin
=
"0,-10,0,0"
/>
</
StackPanel
>
</
telerik:RadButton
>
</
Grid
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
<
Style
x:Key
=
"TimeRulerMonthViewTodayItemStyle"
TargetType
=
"local:TimeRulerMonthViewItem"
>
<
Setter
Property
=
"Foreground"
Value
=
"{StaticResource MonthViewTimeRulerItemForeground_Normal}"
/>
<
Setter
Property
=
"Margin"
Value
=
"0 -1 -1 1"
/>
<
Setter
Property
=
"Canvas.ZIndex"
Value
=
"1"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"local:TimeRulerMonthViewItem"
>
<
Grid
>
<
telerik:RadButton
VerticalAlignment
=
"Stretch"
Padding
=
"0"
Margin
=
"0,0,1,0"
Style
=
"{StaticResource GoToDayTodayButtonStyle}"
Command
=
"local:RadScheduleViewCommands.SetDayViewMode"
CommandParameter
=
"{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.DateTime.Date}"
>
<
StackPanel
Orientation
=
"Vertical"
VerticalAlignment
=
"Center"
IsHitTestVisible
=
"False"
>
<
TextBlock
Text
=
"{Binding Content.DateTime.Day, RelativeSource={RelativeSource TemplatedParent}}"
Foreground
=
"{StaticResource TextBrush}"
Opacity
=
"0.75"
HorizontalAlignment
=
"Center"
FontSize
=
"24"
/>
<
TextBlock
Text
=
"{Binding Content.DateTime, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DateTimeConverter}, ConverterParameter='MMMM'}"
Foreground
=
"{StaticResource TextBrush}"
Opacity
=
"0.75"
HorizontalAlignment
=
"Center"
FontSize
=
"10"
Margin
=
"0,-10,0,0"
/>
</
StackPanel
>
</
telerik:RadButton
>
</
Grid
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
That made my colored special slots for saturdays and sundays not fill the whole area.
I got a tip from you to change the margin of my customized special slots like this:
<
local:CustomSpecialSlotStyleSelector
x:Key
=
"CustomSpecialSlotStyleSelector"
>
<
local:CustomSpecialSlotStyleSelector.SaturdayStyle
>
<
Style
TargetType
=
"telerik:HighlightItem"
>
<
Setter
Property
=
"Margin"
Value
=
"0,-37,0,0"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
>
<
Border
Background
=
"{StaticResource GradientLightBlue}"
Opacity
=
"0.2"
/>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
local:CustomSpecialSlotStyleSelector.SaturdayStyle
>
<
local:CustomSpecialSlotStyleSelector.SundayStyle
>
<
Style
TargetType
=
"telerik:HighlightItem"
>
<
Setter
Property
=
"Margin"
Value
=
"0,-37,0,0"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
>
<
Border
Background
=
"{StaticResource GradientLightRed}"
Opacity
=
"0.2"
/>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
local:CustomSpecialSlotStyleSelector.SundayStyle
>
</
local:CustomSpecialSlotStyleSelector
>
That made the slots fill the whole area fine, but then I got this strange behavior on mondays.
See attached images.
On mondays the orange color from "Today" is spread across the whole week as you can see.
Any other day of week it looks fine. For the second image, "correct tuesday.png" I just changed the date on my computer and reloaded the page.
I have now removed the special slots, but its still the same error. So I start to think that I have made another change that caused this, but I can't find out what.
Do you have any ideas?
Regards,
HÃ¥kan