I have an extended Calendar control that is bound to a class containing a date and state values. The idea is essentially differentiate between national holidays, state holidays, and personal days off. I render these in different colours using a Converter that inspects the current date against the list of objects associated with the calendar control to choose a fill colour for an element in the CalendarDay. This all works perfectly.
The issue is that I want to support that when the user clicks on a day (in a given mode) they can select, or de-select that date as a day off/holiday. using the PreviewMouseDown I select the object by the selected data context (datetime) and update it's state. This works fine, however I cannot get the calendar control to performa a refresh.
The calendar is not bound to my custom class, I'm not sure exactly how a CalendarDay is bound, but it appears to just have a data context pointing at a DateTime value. So NotifyPropertyChanged is out. If I click on a date and switch months and back the date appears highlighted as expected, what I need is to tell the calendar to repaint. I've been scouring for examples on forcing repaints, and nothing has worked so far.
I've tried UpdateLayout() amongst other things. I don't know if this is an issue because I'm trying to re-render from within a mouse event. Any ideas how to repaint a calendar control so that a converter can be kicked off?