英語で読む

次の方法で共有


IntersectionDetail 列挙型

定義

GeometryHitTestParameters のジオメトリとヒットしたビジュアルとの間の交差部分に関する情報を提供します。

C#
public enum IntersectionDetail
継承
IntersectionDetail

フィールド

Empty 1

Geometry ヒット テスト パラメーターと、対象のビジュアル (ジオメトリ) は交差しません。

FullyContains 3

Geometry ヒット テスト パラメーターは、完全に対象ビジュアル (ジオメトリ) の境界の内部にあります。

FullyInside 2

対象のビジュアル (ジオメトリ) は、完全に Geometry ヒット テスト パラメーターの内部にあります。

Intersects 4

Geometry ヒット テスト パラメーターと対象のビジュアル (ジオメトリ) は交差します。 つまり、2 つの要素には重なり合う部分がありますが、どちらか一方が他方の中に完全に含まれてはいません。

NotCalculated 0

IntersectionDetail の値は計算されません。

次の例は、.. のプロパティGeometryHitTestResultを使用する方法をIntersectionDetail示しています。

C#
// Return the result of the hit test to the callback.
public HitTestResultBehavior MyHitTestResultCallback(HitTestResult result)
{
    // Retrieve the results of the hit test.
    IntersectionDetail intersectionDetail = ((GeometryHitTestResult)result).IntersectionDetail;

    switch (intersectionDetail)
    {
        case IntersectionDetail.FullyContains:

            // Add the hit test result to the list that will be processed after the enumeration.
            hitResultsList.Add(result.VisualHit);

            return HitTestResultBehavior.Continue;

        case IntersectionDetail.Intersects:

            // Set the behavior to return visuals at all z-order levels.
            return HitTestResultBehavior.Continue;

        case IntersectionDetail.FullyInside:

            // Set the behavior to return visuals at all z-order levels.
            return HitTestResultBehavior.Continue;

        default:
            return HitTestResultBehavior.Stop;
    }
}

注釈

次の図は、ヒット テスト ジオメトリ (青い円) と視覚ジオメトリ (赤い四角形) の関係を示しています。

ヒット テストで使用される IntersectionDetail のダイアグラム
ヒット テスト中のヒット テスト ジオメトリとビジュアル ジオメトリの交差

適用対象

製品 バージョン
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
Windows Desktop 3.0, 3.1, 5, 6, 7