SelectedDate Property

Calendar.SelectedDate Property


Gets or sets the currently selected date.

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

public Nullable<DateTime> SelectedDate { get; set; }

Property Value

Type: System.Nullable<DateTime>

The date currently selected. The default is null.

Exception Condition

The specified date is outside the range specified by DisplayDateStart and DisplayDateEnd


The specified date is in the BlackoutDates collection.


If set to anything other than null when SelectionMode is set to None.

Identifier field


Metadata properties set to true


Use this property when SelectionMode is set to SingleDate. In other modes, this property will always be the first date in SelectedDates.

<Calendar SelectedDate="dateTimeString"/>


A date that is in one of the formats that are listed in the DateTime XAML Syntax topic.

The following example creates a Calendar with a particular range of displayable dates, and sets the currently selected and displayed date.

.NET Framework
Available since 4.0
Available since 2.0
Return to top
© 2015 Microsoft