Export (0) Print
Expand All

Calendar::SelectionMode Property

Gets or sets a value that indicates what kind of selections are allowed.

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

property CalendarSelectionMode SelectionMode {
	CalendarSelectionMode get ();
	void set (CalendarSelectionMode value);
<Calendar SelectionMode="CalendarSelectionMode"/>

Property Value

Type: System.Windows.Controls::CalendarSelectionMode
A value that indicates the current selection mode. The default is SingleDate.

Identifier field


Metadata properties set to true


This property determines whether the Calendar allows no selection, selection of a single date, or selection of multiple dates. The selection mode is specified with the CalendarSelectionMode enumeration.

When this property is changed, all selected dates will be cleared.

The following example creates a Calendar that has multiple ranges of dates selected.

No code example is currently available or this language may not be supported.
<!-- Create a Calendar that displays dates through
     Januarary 31, 2009 and has dates that are not selectable. -->
<Calendar Margin="20" SelectionMode="MultipleRange"  

    <CalendarDateRange Start="1/2/2009" End="1/4/2009"/>
    <CalendarDateRange Start="1/9/2009" End="1/9/2009"/>
    <CalendarDateRange Start="1/16/2009" End="1/16/2009"/>
    <CalendarDateRange Start="1/23/2009" End="1/25/2009"/>
    <CalendarDateRange Start="1/30/2009" End="1/30/2009"/>


.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4
© 2015 Microsoft