#107 – Markup Extensions in the XAML Namespace
October 27, 2010 1 Comment
Some markup extensions are part of the extensions to XAML added for WPF (e.g. StaticResource). But some markup extensions are part of the XAML vocabulary itself, typically prefixed with x:. They are listed below:
- x:Array – Allows including an array of objects in XAML
- x:Null – A null value
- x:Reference – A reference to another element defined in XAML (XAML 2009)
- x:Static – References a static element in code, e.g. value of a static property
- x:Type – Specifies a .NET type
Hi Sean, can you do a bit on creating your own MarkupExtension? 🙂
I’ve made one for displaying enums (with a special DisplayName like attribute) in a place where I’d like to avoid converters, it all works fine as long as I have the markup extension is in the same dll; But I experience errors when I try to put it into a common project, it all works fine for IValueConverters.
I also noticed it’s OK to have it in a common project as long as you only have a constructor parameter. All gives a compile time error error (MC3074: The tag ‘EnumMarkup’ does not exist in XML namespace)
I can’t seem to be able to get both 🙂
If you or your readers have any ideas it’s much appriciated