Markup Extensions

Markup extensions, like type converters, enable you to extend the expressiveness of XAML. Both can turn a string attribute value into an appropriate object based on the string. As with type converters, several are built into each XAML-based framework, and you cannot create your own markup extensions unless you’re using the .NET Framework.

Unlike type converters, however, markup extensions are invoked from XAML with explicit and consistent syntax. In addition, using markup extensions enables you to overcome potential limitations in existing type converters that you don’t have the power to change. For example, if you want to set a control’s background to a fancy gradient brush with a simple string value, you can write a custom ...

Get XAML Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.