default.aspx
Silverlight .NET Controls and CMS
Home
controls.aspx
Silverlight Controls
Controls
controls/itemviewer.aspx
Silverlight ItemViewer
ItemViewer
Visual Customizations

Customizing the ItemViewer With Styles

The ItemViewer control can be skinned using the standard Silverlight 2 method of setting Styles in the App.xaml file of your Silverlight project.

Example of how to Apply a Skin to the ItemViewer

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


     <Style TargetType="local:ItemViewer">
          <Setter Property="Template">
               <Setter.Value>
                    <ControlTemplate TargetType="local:ItemViewer">
                         <Canvas x:Name="RootElement" Background="#00ffffff">
                              <ScrollViewer x:Name="ElementContainer" BorderThickness="1">
                                   <local:FlowPanel x:Name="ElementChildren" VerticalAlignment="Top" HorizontalAlignment="Left" />
                              </ScrollViewer>
                         </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.

 
This page is 16.33KB and was generated by the SilverPages CMS in 0.203 seconds. Total impressions: 338.