DiagramLinkLayer
Renders cached node-avoiding links and provides scale-independent link hit testing.
继承自: Control
构造函数
public DiagramLinkLayer()
diagramLinkLayer = DiagramLinkLayer()
Initializes a new instance of the DiagramLinkLayer class.
属性
public IDiagramModelAdapter Adapter { get; set; }
value = diagramLinkLayer.Adapter
diagramLinkLayer.Adapter = value
Gets or sets the routed model adapter.
public IReadOnlyDictionary<ICompositionModelLink, IReadOnlyList<DiagramRoutePoint>> DrawnLinks { get; }
value = diagramLinkLayer.DrawnLinks
Gets the links this layer last drew, each with the polyline it drew for it.
internal Control Highlight { get; }
value = diagramLinkLayer.Highlight
Gets the layer that draws, over the nodes, the links the pointer has brought out.
public ICompositionModelLink HoveredLink { get; set; }
value = diagramLinkLayer.HoveredLink
diagramLinkLayer.HoveredLink = value
Gets or sets the currently hovered link.
public Point PanOffset { get; set; }
value = diagramLinkLayer.PanOffset
diagramLinkLayer.PanOffset = value
Gets or sets the current viewport translation.
public IReadOnlyDictionary<string, DiagramNodePresenter> Presenters { get; set; }
value = diagramLinkLayer.Presenters
diagramLinkLayer.Presenters = value
Gets or sets node presenters used to locate sockets and obstacles.
public double Scale { get; set; }
value = diagramLinkLayer.Scale
diagramLinkLayer.Scale = value
Gets or sets the current viewport scale.
internal IReadOnlyCollection<ICompositionModelLink> SelectedLinks { get; set; }
value = diagramLinkLayer.SelectedLinks
diagramLinkLayer.SelectedLinks = value
Gets the links the surface holds selected.
方法
internal IReadOnlyList<ICompositionModelLink> GetLinksInside(Rect area)
result = diagramLinkLayer.GetLinksInside(area)
Finds the links whose whole route lies inside a screen-space rectangle.
- area
- Screen-space rectangle.
返回值: The links inside.
public ICompositionModelLink HitTestLink(Point point, double hitRadius)
result = diagramLinkLayer.HitTestLink(point, hitRadius)
Finds a link near a screen-space pointer position.
- point
- Pointer position.
- hitRadius
- Hit radius in logical pixels.
返回值: The nearest link, or .
public void InvalidateRoutes()
diagramLinkLayer.InvalidateRoutes()
Marks cached routes stale after diagram-space geometry changes.
public void Redraw()
diagramLinkLayer.Redraw()
Draws the links again: those at rest and those the pointer has brought out.
internal void RenderLinks(DrawingContext context, bool isBroughtOut)
diagramLinkLayer.RenderLinks(context, isBroughtOut)
Draws the links that are at rest, or those the pointer has brought out.
- context
- Where to draw.
- isBroughtOut
- Which of the two to draw.
internal void RenderSelection(DrawingContext context)
diagramLinkLayer.RenderSelection(context)
Draws the mark of the selection along each selected link, as the WPF head adorns one.
- context
- Where to draw.
public bool TryHitTestEndpoint(Point point, ICompositionModelLink link, bool isFrom, double hitRadius)
result = diagramLinkLayer.TryHitTestEndpoint(point, link, isFrom, hitRadius)
Finds a routed link endpoint near a screen-space pointer position.
- point
- Pointer position.
- link
- Matched link.
- isFrom
- Whether the output endpoint was matched.
- hitRadius
- Scale-independent hit radius.
返回值: when an endpoint was matched.