Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DatePicker.CalendarStyle Property

Gets or sets the style that is used when rendering the calendar.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
public Style CalendarStyle { get; set; }
<object>
  <object.CalendarStyle>
    <Style .../>
  </object.CalendarStyle>
</object>
<DatePicker CalendarStyle="{resourceExtension styleResourceKey}"/>

XAML Values

resourceExtension

One of the following: StaticResource or DynamicResource. For more information, see XAML Resources.

styleResourceKey

The key that identifies the template being requested. The key refers to an existing resource in a ResourceDictionary.

Property Value

Type: System.Windows.Style
The style that is used when rendering the calendar.

Identifier field

CalendarStyleProperty

Metadata properties set to true

None

Use the CalendarStyle property to specify the appearance of the drop-down calendar.

The following example creates a Style for Calendar and assigns the style to the CalendarStyle property.

<StackPanel>
  <StackPanel.Resources>
    <Style TargetType="Calendar"
           x:Key="DateTimeCalendar">
      <Setter Property="Background" Value="LightBlue"/>
      <Setter Property="BorderBrush" Value="DarkBlue"/>
      <Setter Property="BorderThickness" Value="5"/>
    </Style>

  </StackPanel.Resources>
  <DatePicker Background="DarkBlue"
              CalendarStyle="{StaticResource DateTimeCalendar}"/>
</StackPanel>

.NET Framework

Supported in: 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.