New to Telerik UI for .NET MAUI? Start a free 30-day trial

.NET MAUI Calendar Commands

The .NET MAUI Calendar provides various commands that allow the user to switch between the display modes and views.

Commands for Navigating the Current View

The following commands enable the navigation between same level views:

  • NavigateToNextViewCommand(ICommand)—Gets the command that is executed when the user navigates to the next view.
  • NavigateToPreviousViewCommand(ICommand)—Gets the command that is executed when the user navigates to the previous view.

Commands for Navigating between Views

The following commands enable the navigation between the view levels:

  • NavigateToUpperViewCommand(ICommand)—Gets the command that is executed when the user navigates to the upper view.
  • NavigateToLowerViewCommand(ICommand)—Gets the command that is executed when the user navigates to the lower view..

When switching between view levels, the Calendar implements the following navigation sequence:

  • When navigating to the upper view: Month > Year > Decade > Century.
  • When navigating to the lower view: Century > Decade > Year > Month.

1. Define the Calendar:

<telerik:RadCalendar x:Name="calendar" Grid.Row="1" />

2. Execute the NavigateToNextViewCommand and NavigateToPreviousViewCommand on button click:

<Button Text="Navigate to previous" Command="{Binding NavigateToPreviousViewCommand,Source={x:Reference calendar}}"/>
<Button Text="Navigate to next" Command="{Binding NavigateToNextViewCommand,Source={x:Reference calendar}}"/>

3. Execute the NavigateToUpperViewCommand and NavigateToLowerViewCommand on button click:

<Button Text="Navigate to lower view" Command="{Binding NavigateToLowerViewCommand, Source={x:Reference calendar}}"/>
<Button Text="Navigate to upper view" Command="{Binding NavigateToUpperViewCommand, Source={x:Reference calendar}}"/>

.NET MAUI Calendar Commands

For a runnable example demonstrating the Calendar Commands, see the SDKBrowser Demo Application and go to the Calendar > Commands category.

See Also

In this article