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

TextBox

The TextBox control, pictured in Figure 12.16, enables users to type one or more lines of text.

Image

FIGURE 12.16 Two TextBoxes, one with focus and one without

For Windows Store and universal apps, TextBox has a Header property that can be set to any System.Object (although typically text), a PlaceholderText property that can be set to any watermark string (text that only appears when the TextBox has no real text content), and a Paste event that enables you to distinguish pasted text versus typed text. Figure 12.17 demonstrates Header and PlaceholderText with the following TextBlock:

<TextBox Header="Name" ...

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