O'Reilly logo

Microsoft® Silverlight® Edition: Programming Windows® Phone 7 by Charles Petzold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sharing and Reusing Styles and Templates

As you know, it’s possible to derive one Style from another, in the process inheriting all the Setter objects. The new Style can add to those Setter objects or override them.

However, it is not possible to derive from a ControlTemplate. There’s no way to reference an existing ControlTemplate and specify an additional piece of the visual tree, or a replacement for part of the visual tree. (It’s hard enough imaging the mechanics or syntax of such a process.)

Generally if you want to apply some changes to an existing ControlTemplate, you obtain a copy of that entire template and begin editing it. These default templates are generally included with Silverlight documentation. (However, as I write this chapter, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required