mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-05 08:46:34 +08:00
Mind 出发
This commit is contained in:
@@ -13,6 +13,9 @@ using SvgPathProperties;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
/// <summary>
|
||||
/// DefaultLink
|
||||
/// </summary>
|
||||
public class ConnectionViewModel : SelectableDesignerItemViewModelBase
|
||||
{
|
||||
public ConnectionViewModel(FullyCreatedConnectorInfo sourceConnectorInfo, ConnectorInfoBase sinkConnectorInfo, DrawMode drawMode = DrawMode.ConnectingLineSmooth, RouterMode routerMode = AIStudio.Wpf.DiagramDesigner.RouterMode.RouterNormal) : this(null, sourceConnectorInfo, sinkConnectorInfo, drawMode, routerMode)
|
||||
|
||||
@@ -199,6 +199,9 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
menuOptions.Clear();
|
||||
var orientation = new CinchMenuItem("方向");
|
||||
var none = new CinchMenuItem("无");
|
||||
none.Command = MenuItemCommand;
|
||||
none.CommandParameter = ConnectorOrientation.None;
|
||||
var top = new CinchMenuItem("上");
|
||||
top.Command = MenuItemCommand;
|
||||
top.CommandParameter = ConnectorOrientation.Top;
|
||||
@@ -211,6 +214,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
var right = new CinchMenuItem("右");
|
||||
right.Command = MenuItemCommand;
|
||||
right.CommandParameter = ConnectorOrientation.Right;
|
||||
orientation.Children.Add(none);
|
||||
orientation.Children.Add(top);
|
||||
orientation.Children.Add(bottom);
|
||||
orientation.Children.Add(left);
|
||||
|
||||
@@ -8,12 +8,22 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public class DiagramOption
|
||||
{
|
||||
public LayoutOption LayoutOption
|
||||
{
|
||||
get; set;
|
||||
} = new LayoutOption();
|
||||
|
||||
public ShortcutOption ShortcutOption
|
||||
{
|
||||
get; set;
|
||||
} = new ShortcutOption();
|
||||
}
|
||||
|
||||
public class LayoutOption
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class ShortcutOption
|
||||
{
|
||||
[Description("Select All shortcut (CTRL+A by default)")]
|
||||
|
||||
@@ -503,6 +503,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
get; set;
|
||||
} = new DiagramOption();
|
||||
|
||||
public bool AllowDrop
|
||||
{
|
||||
get; set;
|
||||
} = true;
|
||||
|
||||
private double OffsetX = 10;
|
||||
private double OffsetY = 10;
|
||||
#endregion
|
||||
@@ -742,6 +747,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
PageSizeType = diagramItem.PageSizeType;
|
||||
PhysicalGridMarginSize = diagramItem.PhysicalGridMarginSize;
|
||||
GridColor = diagramItem.GridColor;
|
||||
AllowDrop = diagramItem.AllowDrop;
|
||||
}
|
||||
|
||||
public bool ExecuteEnable(object para)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -10,6 +11,9 @@ using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
/// <summary>
|
||||
/// DefaultGroup
|
||||
/// </summary>
|
||||
public class GroupDesignerItemViewModel : DesignerItemViewModelBase
|
||||
{
|
||||
public GroupDesignerItemViewModel() : this(null)
|
||||
|
||||
@@ -257,6 +257,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
bool AllowDrop
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
System.Windows.Point CurrentPoint
|
||||
{
|
||||
get; set;
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
using AIStudio.Wpf.DiagramDesigner.Services;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
/// <summary>
|
||||
/// DefaultNode
|
||||
/// </summary>
|
||||
public class DefaultDesignerItemViewModel : DesignerItemViewModelBase
|
||||
{
|
||||
public DefaultDesignerItemViewModel() : this(null)
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
private void ExecuteAddItemCommand(object parameter)
|
||||
{
|
||||
FullyCreatedConnectorInfo connector = new FullyCreatedConnectorInfo(this, ConnectorOrientation.Top, true);
|
||||
FullyCreatedConnectorInfo connector = new FullyCreatedConnectorInfo(this, ConnectorOrientation.None, true);
|
||||
MouseButtonEventArgs mosueArg = ((EventToCommandArgs)parameter).EventArgs as MouseButtonEventArgs;
|
||||
var position = mosueArg.GetPosition(((EventToCommandArgs)parameter).Sender as IInputElement);
|
||||
connector.XRatio = (position.X - connector.ConnectorWidth / 2) / connector.DataItem.ItemWidth;
|
||||
|
||||
@@ -5,6 +5,9 @@ using System.Windows.Media;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
/// <summary>
|
||||
/// DefaultTextNode
|
||||
/// </summary>
|
||||
public class TextDesignerItemViewModel : DesignerItemViewModelBase
|
||||
{
|
||||
public TextDesignerItemViewModel() : this(null)
|
||||
|
||||
Reference in New Issue
Block a user