Version

CurrentCalendarMode Property (XamMonthCalendar)

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

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.

Example
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"
    
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    
xmlns:sys="clr-namespace:System;assembly=mscorlib"
    
xmlns:igEditors="http://infragistics.com/Editors"
    
xmlns:igThemes="http://infragistics.com/Themes">
    
<DockPanel>
        
<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" />
        
</ToolBar>
        
<igEditors:XamMonthCalendar
            
x:Name="xamMonthCalendar1"
            
MinCalendarMode="Months" 
            
CurrentCalendarMode="Years" />
    
</DockPanel>
</UserControl>
Requirements

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