title: Block dates in windows apps
body: <p>I am working with DatePicker in Windows apps(tablet desktop). I want to block some date on the datePicker so that user can not select them. I looked up on the google, msdn but could not find much information.</p>
  
  <p>I got suggestions of using 'DisplayDateStart', 'DisplaydateEnd'but when i use them i get errors - 'DatePicker does not contain a definition for DisplayDateStart and no extension method DisplaydateStart accepting a first argument of type DatePicker could be found'.</p>
  
  <p>Please share your thoughts on how to get it working</p>
  
  <p>XAML:</p>
  
  <pre><code>&lt;StackPanel x:Name="spDatePicker"&gt;
  
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>XAML.cs</p>
  
  <pre><code>        DatePicker datePickerWithBlackoutDates = new DatePicker();            
  
          datePickerWithBlackoutDates.DisplayDateStart = new DateTime(2009, 8, 1);
          datePickerWithBlackoutDates.DisplayDateEnd = new DateTime(2009, 8, 31);
          datePickerWithBlackoutDates.SelectedDate = new DateTime(2009, 8, 10);
  
          datePickerWithBlackoutDates.BlackoutDates.Add(
              new CalendarDateRange(new DateTime(2009, 8, 1), new DateTime(2009, 8, 2)));
          datePickerWithBlackoutDates.BlackoutDates.Add(
              new CalendarDateRange(new DateTime(2009, 8, 8), new DateTime(2009, 8, 9)));
          datePickerWithBlackoutDates.BlackoutDates.Add(
              new CalendarDateRange(new DateTime(2009, 8, 15), new DateTime(2009, 8, 16)));
          datePickerWithBlackoutDates.BlackoutDates.Add(
              new CalendarDateRange(new DateTime(2009, 8, 22), new DateTime(2009, 8, 23)));
          datePickerWithBlackoutDates.BlackoutDates.Add(
              new CalendarDateRange(new DateTime(2009, 8, 29), new DateTime(2009, 8, 30)));
  
          datePickerWithBlackoutDates.DateValidationError +=
              new EventHandler&lt;DatePickerDateValidationErrorEventArgs&gt;(DatePicker_DateValidationError);
  
          // root is a Panel that is defined elsewhere.
          spDatePicker.Children.Add(datePickerWithBlackoutDates);
  </code></pre>
  
  <p>Your help much appreciated.
  Thanks
  Rao</p>