Friday, March 4, 2011

What is the best practice for creating RE-USABLE control templates in Silverlight.

What is the best practice for creating re-usable control templates.

For example. I want to start with the standard checkbox and modify its template for re-use accross multiple future projects.

I understand how to modify the template in Blend, but it always wants to save the template to App.xaml of the current project or to the parent control where I first placed the checkbox.

Ideally I would like some soft of ControlLibrary that contains all my custom controls AND custom templates (modified templates of existing controls)

-Jeff

From stackoverflow
  • I don't think you can have a ControlTemplate as a separate entity, without it being attached to a Control. For your control library you can create custom controls that have the appropriate custom templates and reuse the controls.

  • Implicit Style Manager might be helpful.

    The Silverlight controls team and others have been blogging a bit recently about ISM which allows alternative style sets to be applied across the board to standard controls. Try Jesse Liberty's blog or Mehdi Slaoui Andaloussi's blog

    HTH

    Jeff Wilcox : Yeah, the Silverlight Toolkit's ISM is the closest thing you will get. Give it a try, feel free to comment back here if you have any trouble!

0 comments:

Post a Comment