Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
215
Setting Calendar Day background color on 'IsSelected' in XamCalendar?
posted

I am trying to change the background style of the CalendarDay when IsSelected="True" by using a trigger like this:

<Style BasedOn="{StaticResource CalendarDayBase}" TargetType="igPrim:CalendarDay">
<Setter Property="Background" Value="#FFFFC5" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="Red" />
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="BorderThickness" Value="8" />
<Setter Property="Foreground" Value="Red" />
<Setter Property="FontWeight" Value="Bold" />
</Trigger>
</Style.Triggers>
</Style>

The borderthickness gets set, but none of the other properties get set.

I am also re-styling the XamCalendar template, but I have kept the Calendar Day properties the same: 

<Style x:Key="CalendarDayBase"
BasedOn="{StaticResource CalendarItemBase}"
TargetType="igPrim:CalendarDay" />
<Style BasedOn="{StaticResource CalendarDayBase}" TargetType="igPrim:CalendarDay" />

Thanks in advance for any help!