mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-09 02:36:35 +08:00
添加block快,不需要连接线,直接吸附。
This commit is contained in:
@@ -78,7 +78,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault();
|
||||
return Connectors?.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.Top);
|
||||
return Connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.Top);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.Bottom);
|
||||
return Connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.Left);
|
||||
return Connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.Left);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.Right);
|
||||
return Connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.Right);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.TopLeft);
|
||||
return Connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.TopLeft);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.TopRight);
|
||||
return Connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.TopRight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.BottomLeft);
|
||||
return Connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.BottomLeft);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get
|
||||
{
|
||||
return connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.BottomRight);
|
||||
return Connectors?.FirstOrDefault(p => p.Orientation == ConnectorOrientation.BottomRight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
if (SetProperty(ref _showConnectors, value))
|
||||
{
|
||||
foreach (var connector in connectors)
|
||||
foreach (var connector in Connectors)
|
||||
{
|
||||
connector.ShowConnectors = value;
|
||||
}
|
||||
@@ -566,7 +566,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
|
||||
protected ObservableCollection<FullyCreatedConnectorInfo> connectors = new ObservableCollection<FullyCreatedConnectorInfo>();
|
||||
public IEnumerable<FullyCreatedConnectorInfo> Connectors
|
||||
public ObservableCollection<FullyCreatedConnectorInfo> Connectors
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -600,8 +600,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
return Observable
|
||||
.FromEventPattern<NotifyCollectionChangedEventHandler, NotifyCollectionChangedEventArgs>(
|
||||
h => this.connectors.CollectionChanged += h,
|
||||
h => this.connectors.CollectionChanged -= h)
|
||||
h => this.Connectors.CollectionChanged += h,
|
||||
h => this.Connectors.CollectionChanged -= h)
|
||||
.Select(x => x.EventArgs);
|
||||
}
|
||||
}
|
||||
@@ -611,24 +611,24 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
#region 方法
|
||||
public void AddConnector(FullyCreatedConnectorInfo connector)
|
||||
{
|
||||
if (!connectors.Contains(connector))
|
||||
if (!Connectors.Contains(connector))
|
||||
{
|
||||
connectors.Add(connector);
|
||||
Connectors.Add(connector);
|
||||
ConnectorMargin = 0 - connector.ConnectorWidth / 2;
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveConnector(FullyCreatedConnectorInfo connector)
|
||||
{
|
||||
if (connectors.Contains(connector))
|
||||
if (Connectors.Contains(connector))
|
||||
{
|
||||
connectors.Remove(connector);
|
||||
Connectors.Remove(connector);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearConnectors()
|
||||
{
|
||||
connectors.Clear();
|
||||
Connectors.Clear();
|
||||
}
|
||||
|
||||
public void SetCellAlignment()
|
||||
|
||||
Reference in New Issue
Block a user