Telerik UI for Windows Phone by Progress

The RadTimePicker control provides buttons for OK and Cancel out of the box. Whenever the Popup Window gets opened, these two buttons will appear inside the Application Bar of the Windows Phone.

However these two buttons will appear with the default for the OS "X" icon, which means that the provided icon is not available. The first reason for this is that the ApplicationBarButton class cannot be instantiated without setting its IconUri property. So there should be some default value provided. The second one is that currently the Silverlight runtime doesn't allow images to be part of the Telerik assemblies. Because of that no default images for the icons can be provided out of the box.

This is why the icons should be part of the Windows Phone application. There are two ways to provide the icons for the control.

Tip

Here are sample icons for the OK and Cancel buttons that you can use:

Note
The images you use, should have their BuildAction set to Content.

The first way is to use the default paths set in the template for the RadTimePicker control. They are as follows:

  • /Images/DateTimePickerOK.png
  • /Images/DateTimePickerCancel.png

Just put your images at these locations and name them the same way, and they will appear properly.

The other way is to edit the template of the RadTimePicker control and change the paths to the images. This is done by generating the default style for the RadTimePicker control. The buttons are located inside the ApplicationBarInfo property of the RadPickerBox control. To specify the desired paths modify their IconUri properties.

The following topics might be useful, when modifying the template: