Version

Switch to a Different Calendar View

You can use the xamMonthCalendar™ control’s ScrollDirection property to configure the direction in which the calendar item group(s) are scrolled when pressing the navigational arrows.

End users can zoom out to a different calendar view by clicking on a calendar item’s header or zoom in by clicking on a calendar item. You can also switch to a different view programmatically by setting the xamMonthCalendar™ control’s CurrentCalendarMode property to a CalendarMode value or by executing the built-in ZoomOutCalendarMode or ZoomInCalendarMode commands.

The following example code demonstrates how to switch to a different calendar view.

In XAML:

<StackPanel>
    <Button
        Content="Zoom Out"
        Command="{x:Static igEditors:MonthCalendarCommands.ZoomOutCalendarMode}"
        CommandTarget="{Binding ElementName=xamMonthCalendar1}" />
    <igEditors:XamMonthCalendar Name="xamMonthCalendar1" />
</StackPanel>

In Visual Basic:

Imports Infragistics.Windows.Editors
...
'You can set the CurrentCalendarMode property to a CalendarMode value or use the built-in commands.
'Me.xamMonthCalendar1.CurrentCalendarMode = CalendarMode.Years
Me.xamMonthCalendar1.ExecuteCommand(MonthCalendarCommands.ZoomOutCalendarMode)

In C#:

using Infragistics.Windows.Editors;
...
//You can set the CurrentCalendarMode property to a CalendarMode value or use the built-in commands.
//this.xamMonthCalendar1.CurrentCalendarMode = CalendarMode.Years;
this.xamMonthCalendar1.ExecuteCommand(MonthCalendarCommands.ZoomOutCalendarMode);