DatePicker.BlackoutDates Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets a collection of dates that are marked as not selectable.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls (in System.Windows.Controls.dll)

Syntax

'Declaration
Public Property BlackoutDates As CalendarBlackoutDatesCollection
public CalendarBlackoutDatesCollection BlackoutDates { get; private set; }

Property Value

Type: System.Windows.Controls.CalendarBlackoutDatesCollection
A collection of dates that cannot be selected. The default value is an empty collection.

Remarks

Dates in this collection will appear as disabled on the drop-down calendar.

To make all past dates not selectable, you can use the AddDatesInPast method provided by the collection returned by this property.

Adding a date to this collection when it is already selected or adding a date outside the range specified by DisplayDateStart and DisplayDateEnd will cause an ArgumentOutOfRangeException.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.