Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
WPF Fundamentals
XAML
 x:TypeArguments Attribute

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Windows Presentation Foundation
x:TypeArguments Attribute

Passes required constraints to the constructor for a generic type.

<object x:Class="namespace.classname" x:TypeArguments="{x:Type type1}[,{x:Type type2},{x:Type type3,...}]">
   ...
</object>

namespace

Optional. Specifies a CLR namespace that contains the partial class identified by classname. If namespace is specified, a dot (.) separates namespace and classname.

classname

Required. Specifies the CLR name of the partial class that connects the loaded XAML and your code-behind for that XAML.

type1type2type3, ...

Typename of the types to use to constraint the generic instance. The [ and ] in the syntax are not literals; they denote that any more than one type passed to x:TypeArguments is optional. If more than one type is passed, they must each be separated by a comma (,).

x:Class Attribute must also be provided on the same element, and that element must be the root element in a page.

This attribute is only usable for the root element, with x:Class specified for that generic type, and only when that root element maps to a generic type with at least one type argument. An example is PageFunction<(Of <(T>)>).

If the generic has a single type argument, the attribute value is a single type reference, with type specified as attribute value using the x:Type Markup Extension syntax. If the generic has multiple type arguments, the multiple type references are separated by commas within the attribute value.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker