WinUI コントロール
表示
コントロール > Calendar > 表示

Calendar supports three different views, namely month, year and decade view. By default, the calendar displays month view showing month/year format. The calendar control allows you to navigate between the views using the calendar header as shown in the GIF below:

Calendar control showing different views

The table below depicts the three different types of view modes supported in the Calendar control.

View Modes Snapshot
Month

Calendar in month mode

Year

Calendar in year mode

Decade

Calendar in decade mode

You can change the view of the calendar programmatically using ViewMode property of the C1Calendar class. The ViewMode property accesses the CalendarViewMode enumeration to change the calendar view.

The following code demonstrates how to set the year view for the calendar.

XAML
コードのコピー
<calendar:C1Calendar x:Name="calendar" ViewMode="Year" HorizontalAlignment="Center" VerticalAlignment="Top"></calendar:C1Calendar>