Recommended

Skip Navigation LinksHome / Tips / View Tip

Tip: What are the differences in the styles system between Silverlight and WPF?

+ Add to SilverlightShow Favorites
1 comments   /   posted by Denislav Savkov on Sep 18, 2008
(0 votes)
Categories: Styles and Templates

These are the differences:

  • Is it possible to apply a style to all elements in your application?

Unforunately, the Beta 2 does not support implicit styles using the TargetType attribute like WPF. To apply a style to all elements you must explicitly set a value to each Style property.

  • Is it possible to extend a style?

In Silverlight styles cannot be based on other styles. In WPF that is possible using the BasedOn attribute

  • Is it possible to change the style of a control more than once?

No. Styles can be set only once in Silverlight in XAML or in code. After applying a style it is possible to change individual control properties though. You can affect the appearance of a control by changing the Template property and you can do that as many times as you want.

That's it!

Share


Comments

Comments RSS RSS
  • RE: Tip: What are the differences in the styles system between Silverlight and WPF?  

    posted by rama charan on May 30, 2010 20:06

     

    its now possible to use BasedOn attribute

    http://www.silverlightshow.net/tips/Tip-Cascading-Styles-in-Silverlight-3.aspx

Add Comment

 
 

   
  
  
   
Please add 6 and 5 and type the answer here:

Help us make SilverlightShow even better and win a free t-shirt. Whether you'd like to suggest a change in the structure, content organization, section layout or any other aspect of SilverlightShow appearance - we'd love to hear from you! Need a material (article, tutorial, or other) on a specific topic? Let us know and SilverlightShow content authors will work to have that prepared for you. (hide this)