views:

105

answers:

1

Hello, I wanted to highlight some range of days in a Calendar in WPF, and make any other day in the calendar unavailable. So the user could select only the highlighted range. The problem is, I havent found anything useful to do so yet. The control itself doesnt support data binding at all (although it has Data Context property :-)), which makes it somewhat sloppy.

+1  A: 

To make some dates unavailable you can use Calendar.BlackoutDates property. E.g.:

DateTime today = DateTime.Today;
_calendar.BlackoutDates.Add(
    new CalendarDateRange(today.AddDays(-5), today.AddDays(-3)));
repka