共用方式為


ToolGesture.Matches 方法

傳回值,這個值表示這個筆勢是否與輸入事件相符。

命名空間:  Microsoft.Windows.Design.Interaction
組件:  Microsoft.Windows.Design.Interaction (在 Microsoft.Windows.Design.Interaction.dll 中)

語法

'宣告
Public Overrides Function Matches ( _
    targetElement As Object, _
    inputEventArgs As InputEventArgs _
) As Boolean
public override bool Matches(
    Object targetElement,
    InputEventArgs inputEventArgs
)
public:
virtual bool Matches(
    Object^ targetElement, 
    InputEventArgs^ inputEventArgs
) override
abstract Matches : 
        targetElement:Object * 
        inputEventArgs:InputEventArgs -> bool 
override Matches : 
        targetElement:Object * 
        inputEventArgs:InputEventArgs -> bool 
public override function Matches(
    targetElement : Object, 
    inputEventArgs : InputEventArgs
) : boolean

參數

  • targetElement
    型別:System.Object
    這個筆勢的目標項目。

傳回值

型別:System.Boolean
如果這個筆勢與輸入事件相符則為 true,否則為 false。

例外狀況

例外狀況 條件
ArgumentNullException

inputEventArgs 為 nullNull 參照 (即 Visual Basic 中的 Nothing)。

.NET Framework 安全性

請參閱

參考

ToolGesture 類別

Microsoft.Windows.Design.Interaction 命名空間

其他資源

了解 WPF 設計工具擴充性