Hi
Is there a way to change the background color of the active day in a XamMonthCalendar without create a theme? In the same way, I would change the border color of today.
Thanks
Geoffroy
Hi Marianne,
It works great. Thanks.
Hi Geoffroy,
You’ll need to re-template a style.
The process is to identify the control (CalendarDay) that is being used by the xamMonthCalendar. Then you can use the default styles located at C:\Program Files\Infragistics\NetAdvantage 2010.3\WPF\DefaultStyles. Look in the Editors folder for the EditorsGeneric.xaml and the CalendarDay style.
This snippet will apply the style to the work days and the selected calendar days that I defined locally.
<Window.Resources>
<!-- _________________________ CalendarDay ______________________________________ -->
<Style x:Key="CalendarDayBase" TargetType="{x:Type igEditors:CalendarDay}" >
<Style.Triggers>
<Trigger Property="IsWorkday" Value="True">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Background" Value="Bisque" />
</Trigger>
<Trigger Property="IsSelected" Value="True" >
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="Pink" />
</Style.Triggers>
</Style>
<Style TargetType="{x:Type igEditors:CalendarDay}" BasedOn="{StaticResource CalendarDayBase}"/>
</Window.Resources>
<Grid>
<igEditors:XamMonthCalendar />
</Grid>
Hese are some links that will help you identify what you need to do.
http://help.infragistics.com/NetAdvantage/WPF/2010.3/CLR4.0/?page=xamMonthCalendar_About_xamMonthCalendar.html
http://help.infragistics.com/NetAdvantage/WPF/2010.3/CLR4.0/?page=xamMonthCalendar_About_Styling_xamMonthCalendar.html
I’m not sure if you are setting today as selected or you need to set a style based on the value of the day. You can use the calendarDayStyleSelector to set a style for a specific date..
http://help.infragistics.com/NetAdvantage/WPF/2010.3/CLR4.0/?page=InfragisticsWPF4.Editors.v10.3~Infragistics.Windows.Editors.XamMonthCalendar~CalendarDayStyleSelector.html
Let me know if you have further questions.