default.aspx
Silverlight .NET Controls and CMS
Home
controls.aspx
Silverlight Controls
Controls
controls/fieldset.aspx
Silverlight Fieldset Control
Fieldset
Visual Customizations

Customizing the FieldSet Control With Styles

The FieldSet control can be skinned using the standard Silverlight 2 method of using Styles, the default styles can easily be modified to suite the style of your site.

Default Styles for the FieldSet Control

These styles are placed in your XAML and referred to using the Style property:


     <Style TargetType="local:FieldSet">
          <Setter Property="Template">
               <Setter.Value>
                    <ControlTemplate TargetType="local:FieldSet">
                         <Canvas x:Name="RootElement" Background="#00ffffff">
                              <Canvas.Clip>
                                   <RectangleGeometry x:Name="ElementClipping" Rect="6, 3, 244, 24"/>
                              </Canvas.Clip>
                              <Rectangle x:Name="ElementBackground" StrokeThickness="0.5" Stroke="#FF807B76" RadiusX="6" RadiusY="6">
                                   <Rectangle.Fill>
                                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                             <GradientStop Color="#ffffff" Offset="0.0" />
                                             <GradientStop Color="#f0f0f0" Offset="1.0" />
                                        </LinearGradientBrush>
                                   </Rectangle.Fill>
                              </Rectangle>
                              <local:Expand x:Name="ElementExpand" />
                              <CheckBox x:Name="ElementCheckBox" Visibility="Collapsed" />
                              <TextBlock x:Name="ElementText" Text="" FontFamily="Arial" FontSize="12" FontWeight="Bold" Foreground="#000000" />
                        <ContentControl x:Name="ElementContent" Content="{TemplateBinding Content}" />
                         </Canvas>
                    </ControlTemplate>
               </Setter.Value>
          </Setter>
     </Style>

As you can see, styling is a powerful method of customizing the controls to suite the look and feel of your Silverlight application.

  Skinned Silverlight FieldSet Control
 
This page is 23.02KB and was generated by the SilverPages CMS in 0.046 seconds. Total impressions: 568.