Calendar Control in Silverlight 3 Application


Introduction

In this article we will see all properties related to Calendar control.

Crating Silverlight Project

Fire up Expression Blend 3 and create a Silverlight Application. Name it as CalendarControlInSL3.

image1.gif

First things first, search with the keyword "calendar" in Asset Library and you will find the following results.

image2.gif

First we will start with Calendar Control, go ahead and add Calendar control to your Application.

image3.gif

The default properties for the Calendar are as follows:

image4.gif

If you see above we have a property called Display Mode. It has 3 modes such as:

  • Month (By default)
  • Year
  • Decade

If you change these modes it will look similar to the following:

image5.gif

Month Mode

image6.gif

Year Mode

image7.gif

Decade Mode

If you look below the above property you will find another property called Selection Mode. This property helps the user to select based on the modes. Currently we have the following modes:

  • Single Date (By default)
  • Single Range
  • Multiple Range
  • None

The following are the effected Calendar control in various selection modes:

image8.gif

Selection Mode: Single Range (You can use the Shift key to select a range or select by using your mouse)

image9.gif

Selection Mode: Multiple Range (Press and hold CTRL key to select Multiple)

image10.gif

Selection Mode: None (Even if you select any date it will deselected)

image11.gif

There is a property called SelectedDate, this property will make the Calendar select the given date when loaded.

There are two properties called DisplayDateEnd and DisplayDateStart. If you change it the display of the Calendar will be affected. Like, I have changed 1st of July to 31st of July.

image12.gif


Now there is another property called IsTodayHighlighted. By default it is Checked but if you don't want the date to be highlighted you can uncheck it.

image13.gif


We have another property called FirstDayOfWeek. By default it is Sunday, based on your requirement you can change it your date. We have all the 7 days listed in this option.

image14.gif

That's it you have explored about the Calendar Control in Silverlight 3. We will talk about Calendar Control and related to Calendar Control in my forth coming articles.

Enjoy Coding.


Recommended Free Ebook
Similar Articles