Using Book for Silverlight as a Flip Calendar Part 2: Creating the Calendar

In the last part you set up the application. In this part, you will use code and XAML markup to create a calendar using the C1Book control. You will change each page that you added to your application from a <navigation: Page> page type to a <UserControl> page type both in the XAML markup and in the code.

1.   Double-click on CalendarBookResources.xaml to open the page and switch to the XAML view. Replace the markup on the page with the following xaml markup to create your Resource Dictionary:

      XAML to add

2.   Open your MainPage.xaml page by double-clicking on it. Replace the markup on the page with the following xaml markup to create the C1Book control and add some content to the control:

      XAML to add

3.   View MainPage.xaml.cs by right-clicking on the page and choosing View Code from the list. Add the following statements to the top of the page:

      Visual Basic

      C#

4.   Add the following code directly after the InitializeComponent() method:

      Visual Basic

      C#

5.   Double-click on CalendarBookTop.xaml to view the page. Add the following xaml markup to the page, replacing the existing markup:

      XAML to add

6.   Right-click on the page and select View Code from the list to view the code. Use the following code to replace the code on the page, starting with the class. This will change the page to being a UserControl.

      Visual Basic

      C#

7.   Double-click on the CalendarBookBottom.xaml file to open it. Replace the markup on the page with the following XAML markup:

      XAML to add

8.   Right-click on the page and select View Code from the list. Find the class statement and change Page to UserControl.

9.   Open CalendarBookCover.xaml and replace the existing XAML markup with the following:

      XAML to add

10.  Right-click on the page and select View Code from the list. Find the class statement and change Page to UserControl.

11.  Open CalendarTopSpiral.xaml and replace the XAML markup on the page with the following:

      XAML to add

12.  Right-click on the page and select View Code from the list. Find the class statement and change Page to UserControl.

In this part you created a C1Book control and the calendar that the control will display. In the next part, you will run the application.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.