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.
You need to login to Download the default ItemViewer styles, If you do not have a login you can register for free!
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="Background" Value="#ffffff" />
<Setter Property="BorderBrush" Value="#a4a4a4" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:ItemViewer">
<ScrollViewer x:Name="ElementContainer" Padding="2 1 1 1"
Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
VerticalScrollBarVisibility="{TemplateBinding VerticalScrollBarVisibility}" HorizontalScrollBarVisibility="{TemplateBinding HorizontalScrollBarVisibility}"
BorderThickness="{TemplateBinding BorderThickness}">
</ScrollViewer>
</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.
Rate this:
1 Star
2 Star
3 Star
4 Star
5 Star
8 Ratings / 2.5 Average