XamlMember Constructors

Definition

Initializes a new instance of the XamlMember class.

Overloads

XamlMember(EventInfo, XamlSchemaContext)

Initializes a new instance of the XamlMember class using CLR type system EventInfo and a XamlSchemaContext.

XamlMember(PropertyInfo, XamlSchemaContext)

Initializes a new instance of the XamlMember class using CLR type system PropertyInfo and a XamlSchemaContext.

XamlMember(EventInfo, XamlSchemaContext, XamlMemberInvoker)

Initializes a new instance of the XamlMember class using CLR type system EventInfo and a XamlSchemaContext, including XamlMemberInvoker information.

XamlMember(PropertyInfo, XamlSchemaContext, XamlMemberInvoker)

Initializes a new instance of the XamlMember class using reflection PropertyInfo and a XamlSchemaContext, including XamlMemberInvoker information.

XamlMember(String, MethodInfo, XamlSchemaContext)

Initializes a new instance of the XamlMember class for a XamlMember that represents an attachable event.

XamlMember(String, XamlType, Boolean)

Initializes a new instance of the XamlMember class using a string name and declaring XamlType information. A XamlMember that is constructed with this signature has significant limitations.

XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext)

Initializes a new instance of the XamlMember class for a XamlMember that represents an attachable property.

XamlMember(String, MethodInfo, XamlSchemaContext, XamlMemberInvoker)

Initializes a new instance of the XamlMember class for a XamlMember that represents an attachable event, including XamlMemberInvoker information.

XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext, XamlMemberInvoker)

Initializes a new instance of the XamlMember class for a XamlMember that represents an attachable property, including XamlMemberInvoker information.

XamlMember(EventInfo, XamlSchemaContext)

Initializes a new instance of the XamlMember class using CLR type system EventInfo and a XamlSchemaContext.

C#
public XamlMember(System.Reflection.EventInfo eventInfo, System.Xaml.XamlSchemaContext schemaContext);

Parameters

eventInfo
EventInfo

The CLR type system EventInfo that represents the event member.

schemaContext
XamlSchemaContext

The XamlSchemaContext context that qualifies the member.

Remarks

Use this constructor if the member represents an event (event handler connection-point property).

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlMember(PropertyInfo, XamlSchemaContext)

Initializes a new instance of the XamlMember class using CLR type system PropertyInfo and a XamlSchemaContext.

C#
public XamlMember(System.Reflection.PropertyInfo propertyInfo, System.Xaml.XamlSchemaContext schemaContext);

Parameters

propertyInfo
PropertyInfo

The CLR type system PropertyInfo that represents the property member.

schemaContext
XamlSchemaContext

The XamlSchemaContext context that qualifies the member.

Remarks

Use this constructor if the member represents a property (and specifically is not an event handler connection).

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlMember(EventInfo, XamlSchemaContext, XamlMemberInvoker)

Initializes a new instance of the XamlMember class using CLR type system EventInfo and a XamlSchemaContext, including XamlMemberInvoker information.

C#
public XamlMember(System.Reflection.EventInfo eventInfo, System.Xaml.XamlSchemaContext schemaContext, System.Xaml.Schema.XamlMemberInvoker invoker);

Parameters

eventInfo
EventInfo

The CLR type system EventInfo that represents the event member.

schemaContext
XamlSchemaContext

The XamlSchemaContext context that qualifies the member.

invoker
XamlMemberInvoker

The XamlMemberInvoker implementation that handles run-time reflection calls against the XamlMember.

Remarks

Use this constructor if the member represents an event (or an event handler connection-point property).

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlMember(PropertyInfo, XamlSchemaContext, XamlMemberInvoker)

Initializes a new instance of the XamlMember class using reflection PropertyInfo and a XamlSchemaContext, including XamlMemberInvoker information.

C#
public XamlMember(System.Reflection.PropertyInfo propertyInfo, System.Xaml.XamlSchemaContext schemaContext, System.Xaml.Schema.XamlMemberInvoker invoker);

Parameters

propertyInfo
PropertyInfo

The CLR type system PropertyInfo that represents the property member.

schemaContext
XamlSchemaContext

The XamlSchemaContext context that qualifies the member.

invoker
XamlMemberInvoker

The XamlMemberInvoker implementation that handles run-time invocation calls against the XamlMember.

Remarks

Use this constructor only if the member represents a property and if it is not an event handler connection.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlMember(String, MethodInfo, XamlSchemaContext)

Initializes a new instance of the XamlMember class for a XamlMember that represents an attachable event.

C#
public XamlMember(string attachableEventName, System.Reflection.MethodInfo adder, System.Xaml.XamlSchemaContext schemaContext);

Parameters

attachableEventName
String

The string name of the attachable event.

adder
MethodInfo

The CLR type system MethodInfo for the handler Add method of the attachable member's backing implementation.

schemaContext
XamlSchemaContext

The XamlSchemaContext context that qualifies the member.

Remarks

Use this constructor if the member represents an attachable event member.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlMember(String, XamlType, Boolean)

Initializes a new instance of the XamlMember class using a string name and declaring XamlType information. A XamlMember that is constructed with this signature has significant limitations.

C#
public XamlMember(string name, System.Xaml.XamlType declaringType, bool isAttachable);

Parameters

name
String

The string name of the member.

declaringType
XamlType

The XamlType information for the declaring type.

isAttachable
Boolean

true to indicate that the member is attachable; otherwise, false.

Exceptions

name or declaringType is null.

Remarks

A XamlMember that is constructed with the XamlMember(String, XamlType, Boolean) signature returns true for IsUnknown.

For a load path that involves XamlObjectWriter, such a member cannot be written into an object graph. Using the .NET Framework XAML Services implementation, the XamlObjectWriter.WriteStartMember call throws a XamlObjectWriterException when the relevant XamlMember reports true for IsUnknown.

You should not construct a XamlMember with IsUnknown true unless your implementation can handle the exceptions from XamlObjectWriter, or you have other ways to adjust the XamlObjectWriter behavior. For example, one or more of the following might be true of your implementation:

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext)

Initializes a new instance of the XamlMember class for a XamlMember that represents an attachable property.

C#
public XamlMember(string attachablePropertyName, System.Reflection.MethodInfo getter, System.Reflection.MethodInfo setter, System.Xaml.XamlSchemaContext schemaContext);

Parameters

attachablePropertyName
String

The string name of the attachable property.

getter
MethodInfo

The CLR type system MethodInfo for the get accessor of the attachable member's backing implementation.

setter
MethodInfo

The CLR type system MethodInfo for the set accessor of the attachable member's backing implementation.

schemaContext
XamlSchemaContext

The XamlSchemaContext context that qualifies the member.

Remarks

Use this constructor if the member represents an attachable property.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlMember(String, MethodInfo, XamlSchemaContext, XamlMemberInvoker)

Initializes a new instance of the XamlMember class for a XamlMember that represents an attachable event, including XamlMemberInvoker information.

C#
public XamlMember(string attachableEventName, System.Reflection.MethodInfo adder, System.Xaml.XamlSchemaContext schemaContext, System.Xaml.Schema.XamlMemberInvoker invoker);

Parameters

attachableEventName
String

The string name of the attachable event.

adder
MethodInfo

The CLR type system MethodInfo for the handler Add method of the attachable member's backing implementation.

schemaContext
XamlSchemaContext

The XamlSchemaContext context that qualifies the member.

invoker
XamlMemberInvoker

The XamlMemberInvoker implementation that handles run-time invocation calls against the XamlMember.

Remarks

Use this constructor if the member represents an attachable event member.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

XamlMember(String, MethodInfo, MethodInfo, XamlSchemaContext, XamlMemberInvoker)

Initializes a new instance of the XamlMember class for a XamlMember that represents an attachable property, including XamlMemberInvoker information.

C#
public XamlMember(string attachablePropertyName, System.Reflection.MethodInfo getter, System.Reflection.MethodInfo setter, System.Xaml.XamlSchemaContext schemaContext, System.Xaml.Schema.XamlMemberInvoker invoker);

Parameters

attachablePropertyName
String

The string name of the attachable property.

getter
MethodInfo

The CLR type system MethodInfo for the get accessor of the attachable member's backing implementation.

setter
MethodInfo

The CLR type system MethodInfo for the set accessor of the attachable member's backing implementation.

schemaContext
XamlSchemaContext

The XamlSchemaContext context that qualifies the member.

invoker
XamlMemberInvoker

The XamlMemberInvoker implementation that handles run-time invocation calls against the XamlMember.

Remarks

Use this constructor if the member represents an attachable property member.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10