GeometryHitTestParameters(Geometry) コンストラクター

定義

指定された Geometry を使用して GeometryHitTestParameters クラスの新しいインスタンスを初期化します。

public:
 GeometryHitTestParameters(System::Windows::Media::Geometry ^ geometry);
public GeometryHitTestParameters (System.Windows.Media.Geometry geometry);
new System.Windows.Media.GeometryHitTestParameters : System.Windows.Media.Geometry -> System.Windows.Media.GeometryHitTestParameters
Public Sub New (geometry As Geometry)

パラメーター

geometry
Geometry

ヒット テストのジオメトリに使用する Geometry 値。

次の例は、 メソッドに を使用 GeometryHitTestParameters してヒット テストを設定する方法を HitTest 示しています。 Point値は、ヒット テストの範囲を広い表示領域に拡張するオブジェクトを作成Geometryするために使用されます。

// Retrieve the coordinate of the mouse position.
Point pt = e.GetPosition((UIElement)sender);

// Expand the hit test area by creating a geometry centered on the hit test point.
EllipseGeometry expandedHitTestArea = new EllipseGeometry(pt, 10.0, 10.0);

// Set up a callback to receive the hit test result enumeration.
VisualTreeHelper.HitTest(myControl, null,
    new HitTestResultCallback(MyHitTestResultCallback),
    new GeometryHitTestParameters(expandedHitTestArea));
' Retrieve the coordinate of the mouse position.
Dim pt As Point = e.GetPosition(CType(sender, UIElement))

' Expand the hit test area by creating a geometry centered on the hit test point.
Dim expandedHitTestArea As New EllipseGeometry(pt, 10.0, 10.0)

' Set up a callback to receive the hit test result enumeration.
VisualTreeHelper.HitTest(myControl, Nothing, New HitTestResultCallback(AddressOf MyHitTestResultCallback), New GeometryHitTestParameters(expandedHitTestArea))

適用対象

こちらもご覧ください