Chapter 10. Controls and UserControls

 

This chapter covers

  • Understanding the control base types
  • Working with button controls
  • Working with items controls
  • Creating your own UserControls
  • Implementing dependency properties

In the previous chapter, we covered the basics of text, including how to display and edit it. Two of the items discussed—the TextBox and RichTextBox—are both actually controls. The TextBlock isn’t.

If you’re coming from another technology, you may assume that anything you can see or interact with is a control, and you’d be partially right. Interaction generally requires a Control but, to see something such as a TextBlock, it requires only that it be a UIElement (covered in chapter 6).

In this and the following sections, we’ll look at the base control types Control and ContentControl and then dive into the various types of controls, including Button controls and ItemsControls. In your Silverlight travels, you’ll find that understanding these categories of controls will be pretty much all you need to make sense of any new control you run across.

Toward the end of this chapter, we’ll also take our first trip into creating controls of our own. In this case, we’ll follow the simple reuse model: the UserControl. In chapter 24—once we’ve covered binding, resources, styles, and templates—we’ll again revisit creating controls, but with a more robust custom control model.

10.1. Control

 
 
 

10.2. ContentControl

 

10.3. Button controls

 
 

10.4. ItemsControls

 
 
 

10.5. Creating UserControls

 
 

10.6. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage