Telerik UI for Windows Phone by Progress

The RadDatePicker control exposes a Style property which allows you to apply a style to it and modify its appearance.

You have two options:

  • To create an empty style and set it up on your own.
  • To copy the default style of the control and modify it.

This topic will show you how to perform the second one.

Modifying the Default Style

To copy the default styles, load your project in Expression Blend and open the User Control that holds the RadDatePicker control. In the 'Objects and Timeline' pane, select the RadDatePicker control you want to style. From the menu choose Object -> Edit Style -> Edit a Copy . You will be prompted for the name of the style and where to be placed.

Tip
If you choose to define the style in Application, it would be available for the entire application. This allows you to define a style only once and then reuse it where needed.

After clicking 'OK', Expression Blend will generate the default style of the RadDatePicker control in the Resources section of your User Control. The properties available for the style will be loaded in the 'Properties' pane and you will be able to modify their default values. You can also edit the generated XAML in the XAML View or in Visual Studio.

Some of the modifications will require to be made in the template of the control. It gets generated together with the style. To open the template into edit mode just go back to the main scene, right click on the RadDatePicker control and choose Edit Template -> Edit Current

Tip
If you haven't generated the default style yet, you can choose Edit Template -> Edit a Copy. It will generate both the style and the template.

Styling Guidelines

This section will explain you how to style the most important features of the RadDatePicker control.

  • Background - changing the background is done by styling the RadPickerBox control inside the template of the RadDatePicker control.
  • Border Color - changing the color of the border is done by styling the RadPickerBox control inside the template of the RadDatePicker control.
  • Border Thickness - changing the thickness of the border is done by styling the RadPickerBox control inside the template of the RadDatePicker control.
  • Foreground - changing the foreground is done by styling the RadPickerBox control inside the template of the RadDatePicker control.
  • Date Selector Window - to change the window appearance you have to style the RadPickerBox control inside the template of the RadDatePicker control.
  • Application Bar Buttons - to add icons to the buttons, modify their instances in the ApplicaitonBarInfo property of the RadPickerBox inside the template of the RadDatePicker control.
  • Data Selector UI - changing its appearance is done by styling the RadDateSelector control inside the template of the RadDatePicker control.
  • Open Animation - to modify the open animation for the RadDatePicker's popup you have to edit the OpenAnimation resource generated with the style.
  • Close Animation - to modify the close animation for the RadDatePicker's popup you have to edit the CloseAnimation resource generated with the style.
  • OK Button - the OK Button element is to be found inside the ApplicationBarInfo property of the RadPickerBox control inside the template of the RadDatePicker control.
  • Cancel Button - the Cancel Button element is to be found inside the ApplicationBarInfo property of the RadPickerBox control inside the template of the RadDatePicker control.