

The type of markup extension is then identified by the string token immediately following the opening curly brace. When used to provide an attribute value, the syntax that distinguishes a markup extension sequence to a XAML processor is the presence of the opening and closing curly braces (). These are the types of scenarios where a markup extension can provide the solution.Ī markup extension can be implemented to provide values for properties in an attribute usage, properties in a property element usage, or both. Another scenario is that a XAML processor can be instructed to use a syntax that provides non-default arguments to the constructor of an object. Instead, the attribute should result in an object graph that makes a reference to an already constructed object in another part of the graph, or a static object. For example, a XAML processor can be instructed that a value of an attribute should not result in a new object in the object graph. However, there are scenarios where different behavior is required.

One such means is by referencing a type converter this is documented in the topic TypeConverters and XAML. Generally speaking, a XAML parser can either interpret an attribute value as a literal string that can be converted to a primitive, or convert it to an object by some means. This topic specifically details markup extensions for use in WPF XAML. Markup extensions are a general feature of the XAML language and of the. This topic introduces the concept of markup extensions for XAML, including their syntax rules, purpose, and the class object model that underlies them.
