I wanted to hi开发者_开发知识库ghlight 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.
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)));
精彩评论