O'Reilly logo

XAML Unleashed by Adam Nathan

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

Templates

Controls have many properties you can use to customize their look: Button has configurable Background and Foreground Brushes (which can even be fancy gradients or bitmap-based content), Slider’s ticks can be relocated by setting the TickPlacement property, and so on. But you can do only so much with such properties.

A template, on the other hand, allows you to completely replace an element’s visual tree with anything you can dream up, while keeping all of its functionality intact. And templates aren’t just some add-on mechanism for third parties; the default visuals for every Control are defined in templates. The source code for every control is completely separated from its default visual tree representations (or “visual source code”). ...

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