Muokkaa

Jaa


StaticExtension.MemberType Property

Definition

Gets or sets the Type that defines the static member to return.

public:
 property Type ^ MemberType { Type ^ get(); void set(Type ^ value); };
public Type MemberType { get; set; }
member this.MemberType : Type with get, set
Public Property MemberType As Type

Property Value

The Type that defines the static member to return.

Exceptions

Attempted to set MemberType to null.

Remarks

In .NET Framework 4, StaticExtension supports an alternate mode whereby it can return a static member based on Member being the simple member name and its owning type supplied as MemberType, rather than Member providing a full name in the form type.member. The type resolver still acts, but in this case the Member and MemberType are basically combined: memberFullName = MemberType.FullName + "." + Member. Note that this technique will not support XAML namespaces and prefixes; it is working against the backing type system, not the XAML type system.

The string for Member typically uses the format prefix:typeName.fieldOrPropertyName. (prefix is the mapping prefix for an XML namespace, and is only required to reference static values that are not mapped to the default XML namespace).

For XAML usage information, see x:Static Markup Extension.

Applies to