CurrentCalendarMode Property (XamMonthCalendar)

Returns or sets which types of calendar items will be displayed to the end user.
Public Property CurrentCalendarMode As CalendarMode
public CalendarMode CurrentCalendarMode {get; set;}

The XamMonthCalendar provides the ability to zoom out to see larger ranges of dates and then zoom back in to change the selection similar to the functionality found in the Microsoft Vista Common Controls MonthCalendar. The CurrentCalendarMode controls the current mode that the contained CalendarItemGroup instances use to initialize its items. For example, when set to Days, which is the default value, the CalendarItemGroup will contain CalendarDay instances where each represents a discrete date. When set to Months, the CalendarItemGroups will contain CalendarItem instances where each represents a single month within a specific year.

The MonthCalendarCommands class defines two commands (MonthCalendarCommands.ZoomOutCalendarMode and MonthCalendarCommands.ZoomInCalendarMode) that may be used to change the CurrentCalendarMode.

Note: The value for this property cannot be set to a value that would be less than the MinCalendarMode.

The following sample demonstrates how to initialize the MinCalendarMode to control the smallest calendar date range that the end user can navigate to. It also utilizes some of the available commands for controlling the CurrentCalendarMode.

<UserControl x:Class="Xaml.UserControl1"
<ToolBar DockPanel.Dock="Top">
<Button Command="{x:Static igEditors:MonthCalendarCommands.ZoomOutCalendarMode}"
CommandTarget="{Binding ElementName=xamMonthCalendar1}"
Content="Zoom Out" />
<Button Command="{x:Static igEditors:MonthCalendarCommands.ZoomInCalendarMode}"
CommandTarget="{Binding ElementName=xamMonthCalendar1}"
Content="Zoom In" />
CurrentCalendarMode="Years" />

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also