How to implement style in Silverlight ?

Style in Silverlight is similar to CSS of page. Silverlight style allows us to define a common set of formatting characteristics and apply them throughout our application to ensure the consistency in page design.

Here i have created style for button like this

<UserControl x:Class="SilverlightApplication3.MainPage"
mc:Ignorable="d" Height="300" Width="400">
<Style x:Key="ButtonCSS" TargetType="Button">
<Setter Property="Foreground" Value="SeaGreen"/>
<Setter Property="FontSize" Value="28"/>
<Setter Property="Height" Value="50"/>
<Setter Property="Width" Value="200"/>
<Setter Property="FontStyle" Value="Italic"/>

<Button Content="Submit" Style="{StaticResource ButtonCSS}"/>



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.