Hi there
i have a list of datetime. Now, every day in the datetime-list should get a background color in the xamcalendar.
Could you please help me out here?
regards
Cloud
Hello Cloud,
I have modified the sample I sent you before and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Looking forward for your reply.
but one problem still exists.
i´m using this xaml to set the color of my calendardays:
<igEditors:XamMonthCalendar TodayButtonVisibility="Hidden" ShowDisabledDaysOfWeek="True" Name="mcMonthCalendar" Language="de-DE"> <igEditors:XamMonthCalendar.Resources> <converter:DateToColor x:Name="dateConverter" x:Key="dateConverter"></converter:DateToColor> <Style TargetType="{x:Type igEditors:CalendarDay}"> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource Self}, Converter={StaticResource dateConverter}}"></Setter> </Trigger> </Style.Triggers> </Style> </igEditors:XamMonthCalendar.Resources> </igEditors:XamMonthCalendar>
and my converter get as value a calendarday and returns the backgroundcolor for that special day.
now i have this scenario:
i set the range of the calendar with 2 datepicker. and when i press a button i set the min and maxdate of my monthcalendar.
the first time i do this the colors where set correctly and all works fine.
but when i now change the datepicker dates (e.g. mindate - 1month) then the colors are not in the right month but one month earlier.
could you imagine why this happens?
cloud
Since the DisabledDates Property is read only, it cannot be bound to a source, and you are not able to use a Converter. It seems that the approach I suggested you in my previous posts is the best one for achieving the functionality you want.
i still have one question:
is it possible that every time my disableddates change, to give all this dates to a converter who sets me the borderbrush and the background of the calendardayitem?
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.