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

Chapter 16. The Two Templates

Silverlight templates are visual trees of elements and controls defined in XAML. What makes these visual trees special is that they function as patterns or molds to create identical visual trees. Templates are almost always defined as resources, so they are shared, and they almost always contain bindings, so they can be associated with different objects and assume different appearances.

You’ll use one type of template (the DataTemplate) to render objects that otherwise have no visual representation. Use another type (the ControlTemplate) to customize the visual appearance of controls. There’s actually a third type (ItemsPanelTemplate) but this one is very simple and has a special use that I’ll discuss in the next 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