O'Reilly logo

WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4 by Rod Stephens

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

Appendix D. User Interaction Controls

This appendix summarizes controls that are designed to let the user control the application. They let the user initiate and control actions.

Because these controls let the user control the program, they must have some way to interact with the program's executing code. That means they typically use event handlers written in code-behind, events in XAML code, or a mix of both.

The following sections very briefly summarize the WPF user interaction controls. They list the controls' most important properties and provide simple examples. For more detail, see Chapter 7.

Applications often use these controls to start some action and thus catch events raised by the controls. That makes these events more important than those raised by the controls described in previous appendixes.

This appendix focuses more on events than properties. It describes only properties that affect a control's behavior, not the simpler properties that determine the control's appearance.

The IsEnabled property is particularly important to many of the controls described here. It determines whether the control will interact with the user. When IsEnabled is False, the control may change its appearance, but it definitely won't let the user interact with it.

Button

The Button lets the user initiate an action (see Table D-1).

Table D.1. Key Events for Button

Event

Purpose

Click

Fires when the user clicks the Button.

Often a Button displays a simple text value, but if a Button contains several other ...

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