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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.