WinRT XAML (Part 4) Calendar

The Calendar control is unique to ComponentOne. No other vendor has this.

Create date-driven dashboards and scheduling apps with the ComponentOne Calendar™ for WinRT XAML. The C1Calendar control can be used for date navigation, date range selection, and it can display custom calendar information such as appointments.

Features

Gesture-based Month Navigation

By default, C1Calendar supports slide and flick gestures for month-to-month navigation. Or tap the navigation buttons to achieve the same effect.

Date Range Selection

Enable the user to select one day or many days through a default tap or hold and slide gesture. Control the number of days they can select using the MaxSelectionCount property.

Customizable Calendar Settings

Specify the starting day of the week, the work weekdays collection, and more. You can use C1Calendar with any supported culture in WinRT. Visually distinguish between work days and weekends through special brush properties. Make any date bolded to highlight it to the end-user.

Easy and Flexible Styling Model

With C1Calendar you can easily change control brushes without having to override templates. Each visible part of the control has its own brush, including adjacent days, weekends, selected days, the month header and more.

Customize Date Appearance and Content

You can alter the appearance of any individual day using a custom template and template selector. Use custom C1DataTemplateSelector implementations to display custom content within the date blocks, such as appointments from the device’s user data.

Show Week Numbers

Display week numbers by just setting one simple property. There are never any trailing empty weeks because C1Calendar always displays the minimum number of rows required per month whether it is 4, 5 or 6 weeks long.

Getting Started with Calendar:

Step 1 of 3: Creating an Application with a C1Calendar Control

In this step, you'll create a Windows Phone application in Visual Studio using Calendar for Windows Phone.

Complete the following steps:

In Visual Studio 2012 Select File | New | Project.

In the New Project dialog box, expand a language in the left pane, under the language select Windows Metro style, and in the templates list select Blank App (XAML). Enter a Name and click OK to create your project.

Navigate to the Toolbox and drag the C1Calendar icon to onto the design surface on to the grid. This will add the reference and XAML namespace automatically. The XAML markup resembles the following:

This gives the control a name and customizes the formatting and appearance of the calendar’s day slots. In this example we are specifying the appearance of days that contain events. Note that you'll add code for the referenced event handler to add events in a later step.

Add the following markup above the Calendar between the and Calendar:C1Calendar> tags. This XAML is not that important but it shows how you can handle different orientation states in your WinRT application. For example we are changing the date format depending on the orientation. If the app is in Snapped state, we will abbreviate the format and reduce margins.