HitTestResult.VisualHit Propriedade

Definição

Fica com o objeto visual que foi atingido.

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

Valor de Propriedade

Um DependencyObject valor que representa o objeto visual atingido.

Exemplos

O exemplo seguinte mostra como recuperar o valor da VisualHit propriedade num método de callback de teste de impacto.

// 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

Observações

DependencyObject é o tipo em vez de Visual o que o teste de acerto pode ligar árvores 2D e 3D através de uma viewport.

Aplica-se a