DatePickerFormat Enumeration

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

Specifies date formats for a DatePicker.

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

Syntax

'Declaration
Public Enumeration DatePickerFormat
public enum DatePickerFormat
<object property="enumMemberName"/>

Members

Member name Description
Long Specifies that the date should be displayed using unabbreviated days of the week and month names.
Short Specifies that the date should be displayed using abbreviated days of the week and month names.

Examples

The following XAML creates two DatePicker controls, one using the default Short format and the other using the Long format. This example is part of a larger example available in the DatePicker overview.

<!-- Two DatePicker controls, one using the default Short date format -->
<!-- and the other using the Long date format. -->
<StackPanel Orientation="Horizontal" >
<TextBlock Width="200" Margin="5" 
           Text="DatePicker with Short date format and Calendar event handlers:" TextWrapping="Wrap" />
<sdk:DatePicker x:Name="dp1" Height="20" Width="200" />
</StackPanel>
<StackPanel Orientation="Horizontal" >
<TextBlock Width="200" Margin="5"
           Text="DatePicker with Long date format and DateSelected event handler:" TextWrapping="Wrap" />
<sdk:DatePicker Height="20" x:Name="dp2" SelectedDateFormat="Long" Width="200"/>
</StackPanel>

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.