次の方法で共有


PointHitTestResult.VisualHit プロパティ

定義

ヒット テストの結果から返されるビジュアル オブジェクトを取得します。

public:
 property System::Windows::Media::Visual ^ VisualHit { System::Windows::Media::Visual ^ get(); };
public System.Windows.Media.Visual VisualHit { get; }
member this.VisualHit : System.Windows.Media.Visual
Public ReadOnly Property VisualHit As Visual

プロパティ値

Visual

ヒット テストの結果を表す Visual オブジェクト。

次の例は、ヒット テスト結果コールバック関数のプロパティにアクセス VisualHit する方法を示しています。

// Return the result of the hit test to the callback.
public HitTestResultBehavior MyHitTestResult(HitTestResult result)
{
    // Add the hit test result to the list that will be processed after the enumeration.
    hitResultsList.Add(result.VisualHit);

    // Set the behavior to return visuals at all z-order levels.
    return HitTestResultBehavior.Continue;
}
' Return the result of the hit test to the callback.
Public Function MyHitTestResult(ByVal result As HitTestResult) As HitTestResultBehavior
    ' Add the hit test result to the list that will be processed after the enumeration.
    hitResultsList.Add(result.VisualHit)

    ' Set the behavior to return visuals at all z-order levels.
    Return HitTestResultBehavior.Continue
End Function

注釈

この値は VisualHit 、1 回のヒット テスト中に複数のビジュアル オブジェクトを表す可能性があります。 ヒット テストのコールバック メソッドは、ビジュアル ツリーの特定のビジュアル オブジェクトでヒット テストが識別されたときに、ユーザーが実行するアクションを定義します。 アクションを実行した後、他のビジュアル オブジェクトの列挙を続行するかどうかを決定する値を返 HitTestResultBehavior します。 返されるビジュアル オブジェクトの列挙の順序は、レンダリング プレーンでの z オーダーです。

適用対象