Wednesday, January 30, 2013

Difference between Styles & Template

Styles

  1. Styles can be used with any Silverlight Elements that is derived from Framework Element .
  2. By using Styles , u can modify the default values of properties of the control to which the style is applied .
  3. The Properties values in styles can be Overridden by the values that are set on the control itself when it is drawn in the artboard .
  4. Within a style u can only modify pre-existing properties of the Control.
  5. Using Styles u can only specify the default behavior of a control.
Templates
  1. Templates   Used only those elements that inherit from the Control class in the System.Windows.Control namespace.
  2. By using  Templates u can modify the structure of the Control to which the Template is applied.
  3. Templates      Values can’t be overridden by the values that are set on the control itself when it is drawn on the artboard .But , using Template Binding the property’s  value can set of a template according to the values of a properties of the control when it is drawn on the artboard.
  4. When u  Modify with Template u can access to more parts of control then styles.
  5. By  using   Trigger u can specify the behavior of any new & existing parts in a Template.


No comments:

Post a Comment