Wednesday, April 28, 2010

SilverLight 4.0 – Default Style

 

In Silverlight 4 Now we have option to set Default style to particular type of control . for example let say I have 4 button controls in my Silverlight UI. I wanted to define Style for the following properties  Margin, Width and height. here is how we usually define Style in Silverlight 3.0.

image

but in Silverlight 4.0 we no need to specify Name. Just remove the Name attribute from Style as shown below.

image

by removing the Name Attribute we are defining Anonymous  style this Style applies to all the button on our application this makes our XAML Code looks tidy and nice

imageimage

Nandri(Thanks)

SreenivasaRagavan

No comments: