Edit

Bagikan melalui


XamlType.LookupPositionalParameters(Int32) Method

Definition

For markup extension types, returns the types of the positional parameters that are supported in a specific markup extension usage for this XamlType.

protected:
 virtual System::Collections::Generic::IList<System::Xaml::XamlType ^> ^ LookupPositionalParameters(int parameterCount);
protected virtual System.Collections.Generic.IList<System.Xaml.XamlType> LookupPositionalParameters (int parameterCount);
abstract member LookupPositionalParameters : int -> System.Collections.Generic.IList<System.Xaml.XamlType>
override this.LookupPositionalParameters : int -> System.Collections.Generic.IList<System.Xaml.XamlType>
Protected Overridable Function LookupPositionalParameters (parameterCount As Integer) As IList(Of XamlType)

Parameters

parameterCount
Int32

The count (arity) of the particular syntax or constructor mode that you want information about.

Returns

A list of XamlType values where each such XamlType is the type for that position in the syntax. You must specify those types in the same order when supplying markup input for the markup extension.

Remarks

This method can be invoked by calls to GetPositionalParameters.

The default implementation uses internal reflection information based on finding constructors and checking the arity. Override this method if you want GetPositionalParameters to use different logic.

This API is only relevant if this XamlType represents a markup extension (IsMarkupExtension is true).

The input parameterCount is not for requesting the type of a specific positional parameter. It is for specifying the arity of a markup extension usage. Markup extension usage often has multiple signatures and uses different parameter arity (count) of positional parameters to differentiate. However, you can configure a schema context to allow duplicate arities and use types of the positional parameters for differentiation. For more information, see SupportMarkupExtensionsWithDuplicateArity. For a specific arity count, the parameter positions and types can vary. To get the positional type of a specific arity's markup extension usage, you first call GetPositionalParameters with the arity count. Then get the item at that position from the returned collection.

Applies to