Extending an Existing Control
Most of the time when you build a custom element, you'll derive from one of the base classes listed in Table 24-1, such as FrameworkElement, Control, ContentControl, or Panel. In some cases, however, you might be able to tweak an existing control so that it does what you want.
One example is the basic WPF TextBox, which can be enhanced it countless ways. In this section, you'll learn how to create a text box that approximates the MaskedTextBox from the Windows Forms world, which has no WPF equivalent.
Understanding Masked Edit Controls
A masked text box is a text box that automatically formats input as it's entered. For example, if you type 1234567890 into a masked edit control that uses a U.S. telephone number ...