In This Chapter
Using Run
and LineBreak
objects within a TextBlock
Standard fonts in Windows Phone XAML apps
Embedding fonts
Using fonts that have been downloaded at runtime
Using input scope to change the layout of the onscreen keyboard
Customizing the PasswordBox
obscurity character
Data binding the PasswordBox.Password
property
Blending text and rich content in the RichTextBox
Text plays a key role in the design philosophy behind the Windows Phone UI. The Microsoft Design Language, previously known as Metro, is Microsoft’s name for the design of the Windows 8 and Windows Phone UI. Microsoft Design Language, a.k.a. Modern UI, places emphasis on text as a primary design element. Microsoft Design Language is about content, readability, and clarity, and less about chrome (colored backgrounds, borders, and so on).
This chapter begins by looking at the various types used for displaying and entering text in a Windows Phone XAML app, in particular the TextBlock
, TextBox
, PasswordBox
, and RichTextBox
. It then explores each of these elements in greater depth, starting with the TextBlock
, where you see how to create multiline text using Run
and LineBreak
objects. It then looks at font support, including the built-in fonts, and demonstrates techniques for providing custom fonts in your application using font embedding, or via a font data Stream
. It also examines the Software Input Panel (SIP) and shows how to customize the onscreen keyboard using input scopes.
Also included in this chapter is a useful sample page that allows you to preview the various input scopes.
The chapter then looks at the PasswordBox
and demonstrates how to bind the password string property to a viewmodel property. You then learn about the RichTextBox
, which allows you to blend text and rich content such as hyperlinks, images, and other UI elements.
Finally, the chapter looks at the clipboard, and you see how to set the clipboard text and how to detect whether text is present on the clipboard.
3.137.143.219