Can you provide an example/guidance of how to selectively style specific days in a month in a XamCalendar? Specifically I am trying to change the Foreground color of specific days based on business rules.
Hello Mike,
You can create a style which targets CalendarDay and in the style use a converter to change the foreground color based on your business logic. You can then tell the Calendar to use this style by specifying the CalendarDayStyle.
See attached sample.
Let me know if you have any questions.
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
This solution looks great, however the business logic to determine the days to display in a different foreground color are not static. The days to display in a different color are defined in the DataContext of the business object bound to the page that contains the XamCalendar.
Do you have any suggestions how to get both the CalendarDay.StartDate and DataContext of the containing page into the ValueConverter that determines the color?
Yes I have have resolved the issue using your suggestions.
Thank you!
Hello,
Were you able to resolve your issue?
Hello
The following article discussed how to create a mutli-binding in Silverlight:
http://www.codeproject.com/Articles/286171/MultiBinding-in-Silverlight-5
By using this approach you should be able to bind the text to the start date as well as the DataContext of the object.