Class GraphHitTestResult
Result of a graph-wide hit test, identifying what element (if any) was hit and providing typed access to the target.
public class GraphHitTestResult
- Inheritance
-
GraphHitTestResult
- Inherited Members
Properties
CanvasPosition
The position where the hit occurred, in canvas coordinates.
[CoordinateSpace(CoordinateSpace.Canvas)]
public Point CanvasPosition { get; init; }
Property Value
Distance
Distance from the exact hit point to the element. Zero for direct hits, positive for tolerance-based hits.
public double Distance { get; init; }
Property Value
Edge
Gets the hit edge, or null if an edge was not hit.
public Edge? Edge { get; }
Property Value
IsCanvasHit
Whether empty canvas space was clicked (no element hit).
public bool IsCanvasHit { get; }
Property Value
IsHit
public bool IsHit { get; }
Property Value
IsInputPort
Gets whether the hit port is an input port.
public bool IsInputPort { get; }
Property Value
Node
Gets the hit node, or null if a node was not hit.
public Node? Node { get; }
Property Value
Port
Gets the hit port, or null if a port was not hit.
public Port? Port { get; }
Property Value
PortOwner
Gets the owner node of a hit port, or null if a port was not hit.
public Node? PortOwner { get; }
Property Value
ResizeHandle
Gets the hit resize handle position, or null if a resize handle was not hit.
public ResizeHandlePosition? ResizeHandle { get; }
Property Value
ResizeHandleOwner
Gets the node that owns a hit resize handle, or null if a resize handle was not hit.
public Node? ResizeHandleOwner { get; }
Property Value
ShapeResizeHandle
Gets the hit shape resize handle position, or null if a shape resize handle was not hit.
public ResizeHandlePosition? ShapeResizeHandle { get; }
Property Value
ShapeResizeHandleOwner
Gets the shape that owns a hit resize handle, or null if a shape resize handle was not hit.
public ShapeElement? ShapeResizeHandleOwner { get; }
Property Value
Target
public object? Target { get; init; }
Property Value
TargetType
The type of element that was hit.
public HitTargetType TargetType { get; init; }
Property Value
Methods
CanvasHit(Point)
Creates a result indicating empty canvas was hit.
public static GraphHitTestResult CanvasHit(Point canvasPosition)
Parameters
canvasPositionPoint
Returns
EdgeHit(Edge, Point, double)
Creates a result indicating an edge was hit.
public static GraphHitTestResult EdgeHit(Edge edge, Point canvasPosition, double distance = 0)
Parameters
Returns
NodeHit(Node, Point, double)
Creates a result indicating a node was hit.
public static GraphHitTestResult NodeHit(Node node, Point canvasPosition, double distance = 0)
Parameters
Returns
PortHit(Node, Port, bool, Point, double)
Creates a result indicating a port was hit.
public static GraphHitTestResult PortHit(Node node, Port port, bool isInput, Point canvasPosition, double distance = 0)
Parameters
Returns
ResizeHandleHit(Node, ResizeHandlePosition, Point)
Creates a result indicating a resize handle was hit.
public static GraphHitTestResult ResizeHandleHit(Node node, ResizeHandlePosition handlePosition, Point canvasPosition)
Parameters
nodeNodehandlePositionResizeHandlePositioncanvasPositionPoint
Returns
ShapeResizeHandleHit(ShapeElement, ResizeHandlePosition, Point)
Creates a result indicating a shape resize handle was hit.
public static GraphHitTestResult ShapeResizeHandleHit(ShapeElement shape, ResizeHandlePosition handlePosition, Point canvasPosition)
Parameters
shapeShapeElementhandlePositionResizeHandlePositioncanvasPositionPoint