DatePicker - Adding BlackoutDates behavior when SelectedDate uses a Binding

Oct 2, 2009 at 9:02 PM
Edited Mar 5, 2010 at 11:57 PM

Hello all,

I don't want to call this a bug, so I am posting this as a question of "How it was intended to be use".  I have a DatePicker with a binding set for the SelectedDate.  In my case the datasource has a valid default value.  Here is the issue I am comming up with.  At run time, the SelectDate is updated from the source automatically, then the XAML is parsed in where the BlackoutDates property collection is updated.

Here is my issue/question:  The CalendarBlackoutDatesCollection.InsertItem() method throws an exception by design because the SelectedDate value falls within the CalendarDateRange'es specified in the XAML. 

Can someone please explain why the code was designed this way (thinking that perhaps I don't understand the propery usage of the BlackoutDates property?  Or maybe this is a result of someone forgot to negate the "if" block just before the ArgumentOutOfRangeException was thrown?

- Rashad Rivera

Mar 5, 2010 at 5:43 PM

I've run into this too.

Mar 5, 2010 at 11:57 PM


I have since given up on the use of this control.  I could not get it to work so I went with the Telerik WPF control library (see for more details).  While your waiting for a reply (not that I think one is coming), you can use Telerik's demo assemblies to see if it meets your needs. 

- Rashad Rivera