Showing posts with label implicit styling. Show all posts
Showing posts with label implicit styling. Show all posts

Tuesday, March 8, 2011

Implicit Styling - Silverlight 4


Styling in Silverlight is similar to styling in HTML with CSS. It helps you keep your markup (HTML, XAML) code clean by putting all the properties into a separate file. At runtime, both the markup and the styles defined in the external style sheet are merged and give the look to the application as it was intended.

WPF 4 UnleashedStyling was already available in Silverlight. However, up until Silverlight 4, not all of the functions had been implemented (as compared to WPF). The most striking one was the default or implicit styling. Assume you are creating a Silverlight application and all controls of a specific type, for example all Buttons throughout the application should have a particular font size, font weight etc. In previous versions of Silverlight, we had to create a style and apply this style on every instance of the Button. There was no way to tell Silverlight that a particular style was supposed to be the style that had to be applied on all controls of a certain type.