MAUI | ComponentOne
Controls / Calendar / Quick Start
In This Topic
    Quick Start
    In This Topic

    The following quick start guide is intended to get you up and running with the Calendar control. In this quick start, you'll start with creating a new application, add the Calendar control to it, customize it and display the calendar.

    Calendar showing Monday set as the first day of a week

    Setup the App

    1. In Visual Studio, create a new .NET MAUI App. For detailed steps, see Configure MAUI Application.
    2. In the Solution Explorer, right click Dependencies and select Manage NuGet Packages.
    3. In NuGet Package Manager, select nuget.org as the Package source.
    4. Search and select the following package and click Install.
      • C1.Maui.Calendar
    5. Register the Calendar control by adding the following line of code to the CreateMauiApp method in the MauiProgram.cs file.
      HTML
      Copy Code
      .RegisterCalendarControls()
      

    Back to Top

    Configure the References and the Calendar Control

    1. Declare the required namespaces using the following code in XAML:
      XAML
      Copy Code
      xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
      xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
      
    2. Place the cursor between the <ContentPage></ContentPage> tags to add the Calendar control using the following code:
      C#
      Copy Code
      <c1:C1Calendar x:Name="calendar" />
      

    Back to Top

    Build and Run the Project

    1. Click Build | Build Solution to build the project.
    2. Press F5 to run the project.
      Observe that today's date is highlighted in the Calendar.

    Back to Top