Telerik UI for Silverlight

Tip
Before reading this topic, you might find it useful to get familiar with the Template Structure of the RadWindow control.

The RadWindow can be styled by creating an appropriate Style and setting it to the Style property of the control.

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 style, load your project in Expression Blend and open the User Control that holds the RadWindow. From the 'Assets' pane select the RadWindow control and drawa a dummy instance on the art board. In the 'Objects and Timeline' pane select the dummy RadWindow and 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 RadWindow 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.

If you go to the 'Resources' pane, you will see an editable list of resources generated together with the style and used by it. In this list you will find the brushes, styles and templates needed to change the visual appearance of the RadWindow. Their names indicate to which part of the RadWindow appearance they are assigned.

 

  • WindowBackground - a brush that represents the background of the RadWindow's content.
  • WindowOuterBorder - a brush that represents the outer border color of the RadWindow.
  • WindowBorderBackground - a brush that represents the border color of the RadWindow.
  • WindowModalBackground - a brush that represents the modal background behind the RadWindow.
  • WindowInnerBorder - a brush that represents the inner border color of the RadWindow.
  • WindowHeaderBackground - a brush that represents the background color of the RadWindow's header.
  • WindowResizeThumbStyle - the style applied to the resize Thumbs.
  • WindowButtonPadding - the padding applied to the content in the RadWindow's buttons.
  • WindowButtonMargin - the margin applied to the content in the RadWindow's buttons.
  • WindowButtonStyle - the Style applied to the RadWindow's buttons.
  • WindowButtonIconFill - a brush that represents, the fill of the icons in the RadWindow's buttons.
  • WindowButtonIconStroke - a brush that represents the stroke around the icons in the RadWindow's buttons.
  • RadWindowTemplate - the ControlTemplate of the RadWindow.
  • RadWindowStyle - the default Style applied to the RadWindow.
Tip
Changing the value of the resources can be done by clicking on the color indicator or the icon next to them.

Modify the resource to bring the desired appearance of the RadWindow.

 

Finally remove the dummy instance of the RadWindow form the XAML and set the Style to the desired RadWindow instance.

CopyC#
RadWindow radWindow = new RadWindow();
radWindow.Style = this.Resources[ "RadWindowStyle" ] as Style;
CopyVB.NET
Dim radWindow As New RadWindow()
radWindow.Style = TryCast(Me.Resources("RadWindowStyle"), Style)

Here is a snapshot of the result.

 

See Also