O'Reilly logo

WPF Recipes in C# 2008: A Problem-Solution Approach by Sam Noble, Sam Bourton, Allen Jones

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 4. Creating User and Custom Controls

WPF provides developers with unparalleled options in customizing and modifying the visual appearance of controls.

In the first instance, you can simply assign custom values to the appearance properties of the built-in WPF controls. For example, you could set the Background property of a System.Windows.Controls.Button control to silver and the FontWeight property to bold.

If you wanted to reuse this Button control in different places within your application, you could define an application-wide System.Windows.Style to set these property values and then apply this Style to all Button objects automatically (see Chapter 6).

Alternatively, suppose you wanted every Button to display an image surrounded by a ...

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