Chapter 8. Styles, Triggers, and Control Templates

In this chapter we will cover the following:

  • Creating and using styles
  • Applying a style automatically
  • Creating a property trigger
  • Using data triggers
  • Creating an event trigger
  • Creating a multi trigger
  • Using behaviors
  • Replacing the control template of a progress bar
  • Replacing the control template of a scroll bar
  • Customizing selection in a Selector control

Introduction

Consistency in a user interface is an important trait; there are many facets of consistency, one of which is the consistent look and feel of controls. For example, all buttons should look roughly the same – similar colors, the same margins, and so on.

Styles are objects that hold property setters to provide a way to apply a bunch of settings as ...

Get Windows Presentation Foundation 4.5 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.