HOW CAN STYLE ELEMENTS BE APPLIED? (SIMILAR TO A CSS FILE/SKINS)

Amit Singh

Total Post:565

Points:2825
Posted by  Amit Singh
 1399  View(s)
Ratings:
Rate this:
  1. Amit Singh

    Post:565

    Points:2825
    How can style elements be applied? (similar to a CSS file/skins)

    Styles elements are supported in the form of application resources. An app.xaml file can be created containing an application resource Xml construct. The target type for each style is set to the control on which the style needs to be applied.

    App.xaml:
    <Application.Resource>
    <Style x:Key="MyBorder" TargetType="Border">
    <setter property="width" value="5">
    </style>


    Page.xaml:
    <Border Style="{StaticResource MyBorder}">
    ...
    </Border>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!