DiagramViewModel
ViewModel for diagram viewer/editor.
继承自: NotifiableObject
属性
public SizeF CanvasSize { get; set; }
value = diagramViewModel.CanvasSize
diagramViewModel.CanvasSize = value
相机大小 从相机的相机上更新
public DelegateCommand ClearSelectionCommand { get; }
value = diagramViewModel.ClearSelectionCommand
获得命令包 * ClearSelection % 。
public CompositionDiagramElement Composition { get; set; }
value = diagramViewModel.Composition
diagramViewModel.Composition = value
获取或设置可观察到的属性。
public DelegateCommand CopyCommand { get; }
value = diagramViewModel.CopyCommand
获得命令包抄。
public DelegateCommand DeleteCommand { get; }
value = diagramViewModel.DeleteCommand
获得命令包接删除。
public DiagramCanvasDrawable Drawable { get; }
value = diagramViewModel.Drawable
The drawable for GraphicsView.
public DiagramEditorState EditorState { get; }
value = diagramViewModel.EditorState
获得编辑州.
public string ErrorMessage { get; set; }
value = diagramViewModel.ErrorMessage
diagramViewModel.ErrorMessage = value
获取或设置可观测属性 。
public DelegateCommand FitToViewCommand { get; }
value = diagramViewModel.FitToViewCommand
获得命令包 * FitToView % 。
public bool HasComposition { get; }
value = diagramViewModel.HasComposition
是否装入了组装 。
public bool IsDirty { get; set; }
value = diagramViewModel.IsDirty
diagramViewModel.IsDirty = value
获取或设置可观测属性 。
public bool IsEditing { get; set; }
value = diagramViewModel.IsEditing
diagramViewModel.IsEditing = value
获取或设置可观测属性 。
public float PanX { get; set; }
value = diagramViewModel.PanX
diagramViewModel.PanX = value
获取或设置可观测属性 。
public float PanY { get; set; }
value = diagramViewModel.PanY
diagramViewModel.PanY = value
获取或设置可观测属性 。
public DelegateCommand PasteCommand { get; }
value = diagramViewModel.PasteCommand
获得命令包贴。
public DelegateCommand RedoCommand { get; }
value = diagramViewModel.RedoCommand
获得命令包接Redo。
public DelegateCommand ResetViewCommand { get; }
value = diagramViewModel.ResetViewCommand
获得命令包 * ResetView % 。
public DelegateCommand SelectAllCommand { get; }
value = diagramViewModel.SelectAllCommand
获得命令包 * SelectAll % 。
public DiagramElement SelectedElement { get; set; }
value = diagramViewModel.SelectedElement
diagramViewModel.SelectedElement = value
获取或设置可观测属性 。
public DelegateCommand UndoCommand { get; }
value = diagramViewModel.UndoCommand
获得命令来包接撤消。
public float Zoom { get; set; }
value = diagramViewModel.Zoom
diagramViewModel.Zoom = value
获取或设置可观察到的缩放属性。
public DelegateCommand ZoomInCommand { get; }
value = diagramViewModel.ZoomInCommand
获得命令包 * ZoomIn % 。
public DelegateCommand ZoomOutCommand { get; }
value = diagramViewModel.ZoomOutCommand
获得命令包 * ZoomOut % 。
方法
public bool CompleteLinkCreation(SocketKey targetSocketKey)
result = diagramViewModel.CompleteLinkCreation(targetSocketKey)
完全链接到目标套接字 。
public bool CompletePaletteDrag(float screenX, float screenY)
result = diagramViewModel.CompletePaletteDrag(screenX, screenY)
完全调色板拖动并创建新的节点 。
public void ContinueNodeDrag(float diagramX, float diagramY)
diagramViewModel.ContinueNodeDrag(diagramX, diagramY)
继续拖曳一个节点或多个节点.
public void DeleteLink(string fromNodeKey, string fromSocketId, string toNodeKey, string toSocketId)
diagramViewModel.DeleteLink(fromNodeKey, fromSocketId, toNodeKey, toSocketId)
删除两个套接字之间的链接。
public IEnumerable<SocketKey> GetCompatibleSockets()
result = diagramViewModel.GetCompatibleSockets()
获取当前链接源的所有兼容套接字 。
public static DiagramFileData LoadFromFile(string filePath)
result = DiagramViewModel.LoadFromFile(filePath)
从文件中装入图表数据。 注意: 这只返回数据结构。 使用组件装入来进行完全恢复 。
- filePath
- 要从中加载的文件路径 。
返回值: 图表文件数据, 如果无效, 则无效 。
public static DiagramFileData LoadFromStream(Stream stream)
result = DiagramViewModel.LoadFromStream(stream)
从流中装入图表数据。 注意: 这只返回数据结构。 使用成分加载来完全恢复 。
- stream
- 溪来从读.
返回值: 图表文件数据, 如果无效, 则无效 。
public void NotifyClipboardChanged()
diagramViewModel.NotifyClipboardChanged()
通知剪贴板命令状态更改 。
public void NotifyUndoRedoChanged()
diagramViewModel.NotifyUndoRedoChanged()
通知撤销/重做状态可能已经改变 。
public void OnPan(float deltaX, float deltaY)
diagramViewModel.OnPan(deltaX, deltaY)
处理锅手势三角洲。
public void OnPinch(float scale, float focusX, float focusY)
diagramViewModel.OnPinch(scale, focusX, focusY)
手握手势
public void OnTap(float screenX, float screenY)
diagramViewModel.OnTap(screenX, screenY)
处理屏幕坐标的自带。
public void OnTapWithModifier(float screenX, float screenY, bool addToSelection)
diagramViewModel.OnTapWithModifier(screenX, screenY, addToSelection)
多选择的处理自带调试器 。
public void SaveToFile(string filePath)
diagramViewModel.SaveToFile(filePath)
将图表保存到文件 。
- filePath
- 要保存的文件路径 。
public void SaveToStream(Stream stream)
diagramViewModel.SaveToStream(stream)
将图表保存为流 。
- stream
- 溪来作来作来.
public string SaveToString()
result = diagramViewModel.SaveToString()
将图保存为 JSON 字符串 。
返回值: JSON图的表示.
public void SelectNodesInRect(RectF screenRect)
diagramViewModel.SelectNodesInRect(screenRect)
选择屏幕-空间矩形( 橡胶带选择) 内的所有节点 。
public void SetInvalidateCallback(Action invalidate)
diagramViewModel.SetInvalidateCallback(invalidate)
设置画布无效回调 。
public void StartLinkCreation(SocketKey socketKey, float screenX, float screenY)
diagramViewModel.StartLinkCreation(socketKey, screenX, screenY)
开始从套接字创建链接 。
public void StartNodeDrag(string nodeKey, float diagramX, float diagramY)
diagramViewModel.StartNodeDrag(nodeKey, diagramX, diagramY)
开始拖曳一个节点(或者如果节点处于多选状态,则会多次拖曳).
public void StartPaletteDrag(PaletteItem item, float screenX, float screenY)
diagramViewModel.StartPaletteDrag(item, screenX, screenY)
开始从调色板上拖取元素 。
private bool TryCreateElement(PaletteItem item, float x, float y)
result = diagramViewModel.TryCreateElement(item, x, y)
尝试在指定位置创建新元素 。
public void UpdateLinkCreation(float screenX, float screenY)
diagramViewModel.UpdateLinkCreation(screenX, screenY)
更新链接创建终点 。
public void UpdateLinkHover(SocketKey hoverSocket)
diagramViewModel.UpdateLinkHover(hoverSocket)
更新链接徘徊验证状态 。
public void UpdatePaletteDrag(float screenX, float screenY, bool isOverCanvas)
diagramViewModel.UpdatePaletteDrag(screenX, screenY, isOverCanvas)
更新调色板拖动位置 。
public bool ValidateLink(SocketKey source, SocketKey target, string error)
result = diagramViewModel.ValidateLink(source, target, error)
验证两个套接字之间能否创建链接 。
- source
- 源套接字 。
- target
- 目标插座
- error
- 如果无效, 则错误消息 。
返回值: 如果链接有效, 则为真 。
private bool WouldCreateCycle(string fromNodeKey, string toNodeKey)
result = diagramViewModel.WouldCreateCycle(fromNodeKey, toNodeKey)
请检查是否添加链接会在图中创建循环 。