DiagramPanel
Avalonia control that hosts and renders diagram elements.
Наследует: Control
Конструкторы
DiagramPanel()
Initializes a new instance of the DiagramPanel.
Свойства
Model : ICompositionModel
The diagram model to display.
PanOffset : Point
Pan offset for scrolling.
SelectedNodeKey : string
Key of the selected node.
SelectedNodeKeys : IReadOnlySet<string>
Get all selected node keys.
Методы
AddToSelection(string)
Add a node to the selection.
ClearDropTargetHighlight()
Clears any drop target highlighting.
ClearSelection()
Clear all selections.
Copy()
Copy selected nodes to clipboard.
Cut()
Cut selected nodes to clipboard.
DeleteLink(string, string, string, string)
Delete the link between two sockets.
DeleteSelected()
Delete selected nodes and their connected links.
DiagramToScreen(Point) : Point
Converts a diagram coordinate to screen coordinate.
- diagram
- Diagram coordinate.
Возвращает: Screen coordinate relative to this control.
FitView()
Fit all nodes into the view.
GetNodeAtPosition(Point) : string
Gets the node key at the specified screen position, if any.
- screenPosition
- Screen position to test.
Возвращает: Node key if found, null otherwise.
HideDragPreview()
Hides the drag preview.
HighlightDropTarget(string, bool)
Highlights a node as a potential drop target.
- nodeKey
- Key of the node to highlight, or null to clear.
- isValid
- Whether this is a valid drop target.
OnKeyDown(KeyEventArgs)
OnPointerMoved(PointerEventArgs)
OnPointerPressed(PointerPressedEventArgs)
OnPointerReleased(PointerReleasedEventArgs)
OnPointerWheelChanged(PointerWheelEventArgs)
Paste()
Paste nodes from clipboard.
Render(DrawingContext)
ResetView()
Reset view to default zoom and position.
ScreenToDiagram(Point) : Point
Converts a screen coordinate to diagram coordinate.
- screen
- Screen coordinate relative to this control.
Возвращает: Diagram coordinate.
SelectAll()
Select all nodes.
ShowDragPreview(Point, string, Color?)
Shows a drag preview ghost at the specified screen position.
- screenPosition
- Screen position relative to this control.
- elementName
- Name to display in the preview.
- previewColor
- Optional custom color for the preview.
UpdateDragPreview(Point)
Updates the drag preview position during drag.
- screenPosition
- New screen position.
ZoomIn()
Zoom in by 25%.
ZoomOut()
Zoom out by 25%.
События
ModelModified : EventHandler
Occurs when the diagram model is modified.
SelectionChanged : EventHandler<string>
Occurs when the selected node changes.
Поля
IsEditingProperty : StyledProperty<bool>
Identifies the IsEditing dependency property.
ModelProperty : StyledProperty<ICompositionModel>
Identifies the Model dependency property.
PanOffsetProperty : StyledProperty<Point>
Identifies the PanOffset dependency property.
SelectedNodeKeyProperty : StyledProperty<string>
Identifies the SelectedNodeKey dependency property.
ZoomProperty : StyledProperty<double>
Identifies the Zoom dependency property.