Style

All the controls in XWT are support the feature "Style". By using styles, user can define a common appearance such as fonts, colors and images to a control.

The controls in XWT have a default style, users can change it by setting Style property. For example, we can set a Control's background red with the following code.

    <Composite.Resources>
        <Style x:Key="myStyle">
            <Setter Property="Background" Value="Red"/>
        </Style>
    </Composite.Resources>

The above code is only the defined resource, can do nothing without controls. x:Key="myStyle" is used to define the Resourcekey for this requested resource. User can specifying the value of the ResourceKey property by using StaticeResource. There list a Label for example.

    <Label Style="{StaticResource myStyle}" Text="Hello"/>
***************photos******************

The Style feature also can be applied for the integrated applications. There is a little different from the above sample. In the above sample, Style resource is defined stand along with a key. Any controls can use it with the key. But here, the resource is bind to define the integrated applications.

    <Composite.Resources>
        <Style TargetType="{x:Type j:MyUserControl}">
            <Setter Property="Background" Value="Red"/>
        </Style>
    </Composite.Resources>
    ...
    <j:MyUserControl/>