DiagramViewModel

StockSharp.Xaml.Diagram.Maui

ViewModel for diagram viewer/editor.

継承元: NotifiableObject

プロパティ

CanvasSize : SizeF

Canvas size, updated from DiagramPage.SizeChanged.

ClearSelectionCommand : DelegateCommand

Gets the command wrapping ClearSelection.

Composition : CompositionDiagramElement

Gets or sets the Composition observable property.

CopyCommand : DelegateCommand

Gets the command wrapping Copy.

CutCommand : DelegateCommand

Gets the command wrapping Cut.

DeleteCommand : DelegateCommand

Gets the command wrapping Delete.

Drawable : DiagramCanvasDrawable

The drawable for GraphicsView.

EditorState : DiagramEditorState

Gets the editor state.

ErrorMessage : string

Gets or sets the ErrorMessage observable property.

FitToViewCommand : DelegateCommand

Gets the command wrapping FitToView.

HasComposition : bool

Whether a composition is loaded.

IsDirty : bool

Gets or sets the IsDirty observable property.

IsEditing : bool

Gets or sets the IsEditing observable property.

PanX : float

Gets or sets the PanX observable property.

PanY : float

Gets or sets the PanY observable property.

PasteCommand : DelegateCommand

Gets the command wrapping Paste.

RedoCommand : DelegateCommand

Gets the command wrapping Redo.

ResetViewCommand : DelegateCommand

Gets the command wrapping ResetView.

SelectAllCommand : DelegateCommand

Gets the command wrapping SelectAll.

SelectedElement : DiagramElement

Gets or sets the SelectedElement observable property.

Selection : ISelectionModel

Gets the selection model.

Title : string

Title for the page.

UndoCommand : DelegateCommand

Gets the command wrapping Undo.

Zoom : float

Gets or sets the Zoom observable property.

ZoomInCommand : DelegateCommand

Gets the command wrapping ZoomIn.

ZoomOutCommand : DelegateCommand

Gets the command wrapping ZoomOut.

メソッド

CancelLinkCreation()

Cancel link creation.

CancelNodeDrag()

Cancel node drag and restore original position.

CancelPaletteDrag()

Cancel palette drag.

ClearSelection()

Clear selection.

CompleteLinkCreation(SocketKey) : bool

Complete link creation to target socket.

CompletePaletteDrag(float, float) : bool

Complete palette drag and create new node.

ContinueNodeDrag(float, float)

Continue dragging a node or multiple nodes.

Copy()

Copy selected elements to clipboard.

Cut()

Cut selected elements to clipboard.

Delete()

Delete selected elements.

EndNodeDrag()

End node drag.

FitToView()

Fit diagram to view.

GetCompatibleSockets() : IEnumerable<SocketKey>

Get all compatible sockets for the current link source.

Invalidate()

Request canvas redraw.

LoadFromFile(string) : DiagramFileData

Load diagram data from a file. Note: This only returns the data structure. Use composition loading for full restore.

filePath
The file path to load from.

戻り値: Diagram file data, or null if invalid.

LoadFromStream(Stream) : DiagramFileData

Load diagram data from a stream. Note: This only returns the data structure. Use composition loading for full restore.

stream
The stream to read from.

戻り値: Diagram file data, or null if invalid.

NotifyClipboardChanged()

Notify clipboard command state changes.

NotifyUndoRedoChanged()

Notify that undo/redo state may have changed.

OnPan(float, float)

Handle pan gesture delta.

OnPinch(float, float, float)

Handle pinch gesture.

OnTap(float, float)

Handle tap at screen coordinates.

OnTapWithModifier(float, float, bool)

Handle tap with modifier for multi-select.

Paste()

Paste elements from clipboard.

Redo()

Redo the last undone action.

ResetView()

Reset zoom and pan to default.

SaveToFile(string)

Save the diagram to a file.

filePath
The file path to save to.
SaveToStream(Stream)

Save the diagram to a stream.

stream
The stream to write to.
SaveToString() : string

Save the diagram to a JSON string.

戻り値: JSON representation of the diagram.

SelectAll()

Select all elements.

SelectNodesInRect(RectF)

Select all nodes within a screen-space rectangle (rubber band selection).

SetInvalidateCallback(Action)

Set the canvas invalidation callback.

StartLinkCreation(SocketKey, float, float)

Start creating a link from a socket.

StartNodeDrag(string, float, float)

Start dragging a node (or multiple if the node is in a multi-selection).

StartPaletteDrag(PaletteItem, float, float)

Start dragging an element from the palette.

TryCreateElement(PaletteItem, float, float) : bool

Try to create a new element at the specified position.

Undo()

Undo the last action.

UpdateLinkCreation(float, float)

Update link creation endpoint.

UpdateLinkHover(SocketKey)

Update link hover validation state.

UpdatePaletteDrag(float, float, bool)

Update palette drag position.

WouldCreateCycle(string, string) : bool

Check if adding a link would create a cycle in the graph.

ZoomIn()

Zoom in by 25%.

ZoomOut()

Zoom out by 25%.