Share via


ToolCommand.CanExecute Method

Locates a command binding for the command and asks if it is enabled.

Namespace:  Microsoft.Windows.Design.Interaction
Assembly:  Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)

Syntax

'Declaration
Public Function CanExecute ( _
    data As GestureData _
) As Boolean
public bool CanExecute(
    GestureData data
)
public:
bool CanExecute(
    GestureData^ data
)
member CanExecute : 
        data:GestureData -> bool 
public function CanExecute(
    data : GestureData
) : boolean

Parameters

Return Value

Type: System.Boolean
true if the command is enabled; false if it is disabled or there is no binding for it.

Exceptions

Exception Condition
ArgumentNullException

data is nulla null reference (Nothing in Visual Basic).

ArgumentException

data.Context is nulla null reference (Nothing in Visual Basic).

.NET Framework Security

See Also

Reference

ToolCommand Class

Microsoft.Windows.Design.Interaction Namespace

Other Resources

Tool Architecture

Understanding WPF Designer Extensibility