Calendar::DisplayDate Property
Gets or sets the date to display.
Assembly: PresentationFramework (in PresentationFramework.dll)
The DisplayDate and DisplayMode properties specify what the calendar displays and what has focus within the calendar. The user can change the SelectedDate only when DisplayMode is set to Month, but the user might change the DisplayDate when the Calendar is in Year and Decade mode. The following table describes how the mode changes the DisplayDate.
DisplayMode | Action |
|---|---|
Month | DisplayDate changes when the user navigates to a different month. |
Year | The month of DisplayDate changes when the user clicks or navigates to a different month. |
Decade | The year of DisplayDate changes when the user clicks or navigates to another year. |
DisplayDate is ignored if its value is outside of the range of dates that is specified by DisplayDateStart and DisplayDateEnd properties.
Identifier field | |
Metadata properties set to true |
<Calendar DisplayDate="dateTimeString"/>
- dateTimeString
A date that is in one of the formats that are listed in the DateTime XAML Syntax topic.
The following code sets up a Calendar with a particular range of displayable dates, and sets the currently selected and displayed date.
<!-- Create a Calendar that displays 1/10/2009 through 4/18/2009. --> <Calendar Margin="20" SelectedDate="2/15/2009" DisplayDate="3/15/2009" DisplayDateStart="1/10/2009" DisplayDateEnd="4/18/2009"/>
Available since 4.0
Silverlight
Available since 2.0