#107 – Markup Extensions in the XAML Namespace

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
Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #107 – Markup Extensions in the XAML Namespace

  1. Maxie says:

    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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: