IntersectionDetail Výčet
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Poskytuje informace o průsečíku mezi geometriemi v GeometryHitTestParameters a vizuálem, který byl nalezen.
public enum class IntersectionDetail
public enum IntersectionDetail
type IntersectionDetail =
Public Enum IntersectionDetail
- Dědičnost
Pole
| Name | Hodnota | Description |
|---|---|---|
| NotCalculated | 0 | Hodnota IntersectionDetail se nevypočítá. |
| Empty | 1 | Test Geometry hit parametru a cílového vizuálu nebo geometrie neprotínají. |
| FullyInside | 2 | Cílový vizuál nebo geometrie je plně uvnitř parametru testu hitu Geometry . |
| FullyContains | 3 | Parametr Geometry testu hitu je plně obsažen v hranici cílového vizuálu nebo geometrie. |
| Intersects | 4 | Parametr Geometry testu hitu a cílový vizuál nebo geometrie protínají. To znamená, že se oba prvky překrývají, ale ani jeden prvek neobsahuje druhý prvek. |
Příklady
Následující příklad ukazuje, jak použít IntersectionDetail vlastnost GeometryHitTestResult.
// 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;
}
}
' Return the result of the hit test to the callback.
Public Function MyHitTestResultCallback(ByVal result As HitTestResult) As HitTestResultBehavior
' Retrieve the results of the hit test.
Dim intersectionDetail As IntersectionDetail = (CType(result, GeometryHitTestResult)).IntersectionDetail
Select Case 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
Case Else
Return HitTestResultBehavior.Stop
End Select
End Function
Poznámky
Následující obrázek znázorňuje vztah mezi geometrií testu hitu (modrý kruh) a geometrií vizuálu (červený čtverec).
Průnik mezi geometrií testu a vizuální geometrií během testování