Skip to content

x:TypeArguments now works like all other XAML type references

September 6, 2006

I got an internal question about x:TypeArguments syntax as somebody was migrating an old PageFunction example to RC1.

x:TypeArguments used to blindly make “Object” work. It would just paste it into the .g.cs file via the codedom. It worked because there happened to be a using statement for System.

We now require the same type syntax that you would need to refer to any type inside of an objectelement.

Since you must qualify <Object> as <sys:Object /> as shown here:

<sys:Object xmlns:sys="clr-namepsace:System;assembly=mscorlib" />

Thus you must use sys:Object inside the value of x:TypeArguments as well:

<PageFunction
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namepsace:System;assembly=mscorlib"
    x:TypeArguments="sys:Object"
    >
    …
</PageFunction>

From → XAML (non-UI)

Leave a Comment

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: