mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
demo提交
This commit is contained in:
@@ -68,22 +68,66 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
#region 属性
|
||||
public FullyCreatedConnectorInfo TopConnector
|
||||
{
|
||||
get { return (connectors != null && connectors.Count >= 1) ? connectors[0] : null; }
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.Top);
|
||||
}
|
||||
}
|
||||
|
||||
public FullyCreatedConnectorInfo BottomConnector
|
||||
{
|
||||
get { return (connectors != null && connectors.Count >= 2) ? connectors[1] : null; }
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
public FullyCreatedConnectorInfo LeftConnector
|
||||
{
|
||||
get { return (connectors != null && connectors.Count >= 3) ? connectors[2] : null; }
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.Left);
|
||||
}
|
||||
}
|
||||
|
||||
public FullyCreatedConnectorInfo RightConnector
|
||||
{
|
||||
get { return (connectors != null && connectors.Count >= 4) ? connectors[3] : null; }
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.Right);
|
||||
}
|
||||
}
|
||||
|
||||
public FullyCreatedConnectorInfo TopLeftConnector
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.TopLeft);
|
||||
}
|
||||
}
|
||||
|
||||
public FullyCreatedConnectorInfo TopRightConnector
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.TopRight);
|
||||
}
|
||||
}
|
||||
|
||||
public FullyCreatedConnectorInfo BottomLeftConnector
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.BottomLeft);
|
||||
}
|
||||
}
|
||||
|
||||
public FullyCreatedConnectorInfo BottomRightConnector
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.BottomRight);
|
||||
}
|
||||
}
|
||||
|
||||
public Style ConnectorStyle
|
||||
@@ -244,7 +288,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
[CanDo]
|
||||
[CanDo]
|
||||
public PointBase TopLeft
|
||||
{
|
||||
get
|
||||
@@ -317,13 +361,28 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
/// <summary>
|
||||
/// 连接点是否可以按偏移自定义
|
||||
/// </summary>
|
||||
public bool IsInnerConnector { get; set; }
|
||||
public bool IsInnerConnector
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
private ObservableCollection<FullyCreatedConnectorInfo> connectors = new ObservableCollection<FullyCreatedConnectorInfo>();
|
||||
public IEnumerable<FullyCreatedConnectorInfo> Connectors { get { return connectors; } }
|
||||
protected ObservableCollection<FullyCreatedConnectorInfo> connectors = new ObservableCollection<FullyCreatedConnectorInfo>();
|
||||
public IEnumerable<FullyCreatedConnectorInfo> Connectors
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors;
|
||||
}
|
||||
}
|
||||
|
||||
protected ObservableCollection<CinchMenuItem> menuOptions;
|
||||
public IEnumerable<CinchMenuItem> MenuOptions { get { return menuOptions; } }
|
||||
public IEnumerable<CinchMenuItem> MenuOptions
|
||||
{
|
||||
get
|
||||
{
|
||||
return menuOptions;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowMenuOptions
|
||||
{
|
||||
@@ -336,7 +395,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public bool BeginDo { get; set; }
|
||||
public bool BeginDo
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public IObservable<NotifyCollectionChangedEventArgs> WhenConnectorsChanged
|
||||
{
|
||||
@@ -415,7 +477,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
this.Top = (int)(this.Top / Root.GridCellSize.Height) * Root.GridCellSize.Height + Root.GridMarginSize.Height + (Root.GridCellSize.Height - this.ItemHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RaiseTopLeft()
|
||||
@@ -443,7 +505,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
var rightPort = RightConnector;
|
||||
var bottomPort = BottomConnector;
|
||||
|
||||
var left = leftPort == null ? Position.X: Math.Min(Position.X, leftPort.Position.X);
|
||||
var left = leftPort == null ? Position.X : Math.Min(Position.X, leftPort.Position.X);
|
||||
var top = topPort == null ? Position.Y : Math.Min(Position.Y, topPort.Position.Y);
|
||||
var right = rightPort == null ? Position.X + ItemWidth :
|
||||
Math.Max(rightPort.Position.X + rightPort.ConnectorWidth, Position.X + ItemWidth);
|
||||
|
||||
Reference in New Issue
Block a user