Invoke Element

Specifies a rule action that invokes a method.

Syntax

<Invoke
    ExclusiveApply="{true | false}"
    InvokePolicy="InvokePolicy enumeration"
    ResultTarget="ObjectPath element"
    Target="ObjectPath element"
    Transformer="object"
 >
    <HandleExceptions />
    <Transformer />
</Invoke>

Attributes

ExclusiveApply

Specifies whether to continue applying actions to this target after an application of this action. By default, this value is false.

HandleExceptions

Indicates the HandleException exception handler defined for this object.

InvokePolicy

Specifies how to invoke the target. This value must be a member of the InvokePolicy enumeration. By default, this value is AsynchronousNormal.

ResultTarget

An object path in the form [ObjectName.Member] that specifies the location to store results.

Target

An object path in the form [ObjectName.Member] that specifies the action target.

Transformer

Indicates a data converter for the result value before it is set on the result target. You can use inline or expanded construction. Possible transformer elements include:

BooleanTransformer

DateTimeTransformer

FormatTransformer

MathTransformer

TimeSpanTransformer

Remarks

If a command is passed in as a property, you can invoke it by calling the Command.Invoke method.

For example, the following property contains a command:

<me:Menu Command="[somecommand]"/>

The Target attribute of the Invoke element invokes the command as follows:

    <Actions>
        <Invoke Target="[Command.Invoke]"/>
    </Actions>

For an example of how to pass parameters to the command, see the Markup.Rules.CustomRule.InvokeAction.mcml sample in the Sample Explorer.

Requirements

Platform: Windows Vista Ultimate, Windows Vista Home Premium, and later

See Also