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 ...

Get WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4 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.