mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 08:10:50 +08:00
添加block快,不需要连接线,直接吸附。
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public class BlockConnectorInfo : FullyCreatedConnectorInfo
|
||||
{
|
||||
public BlockConnectorInfo(DesignerItemViewModelBase dataItem, ConnectorOrientation orientation) : this(null, dataItem, orientation)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public BlockConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, ConnectorOrientation orientation) : base(root, dataItem, orientation)
|
||||
{
|
||||
if (Orientation == ConnectorOrientation.Left || Orientation == ConnectorOrientation.Right)
|
||||
{
|
||||
ConnectorWidth = 4;
|
||||
ConnectorHeight = double.NaN;
|
||||
}
|
||||
else if (Orientation == ConnectorOrientation.Top || Orientation == ConnectorOrientation.Bottom)
|
||||
{
|
||||
ConnectorWidth = double.NaN;
|
||||
ConnectorHeight = 4;
|
||||
}
|
||||
}
|
||||
|
||||
public BlockConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, SerializableItem serializableItem, string serializableType) : base(root, dataItem, serializableItem, serializableType)
|
||||
{
|
||||
}
|
||||
|
||||
public BlockConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, SelectableItemBase designer) : base(root, dataItem, designer)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void InitNew()
|
||||
{
|
||||
base.InitNew();
|
||||
ColorViewModel.LineColor.Color = Colors.Transparent;
|
||||
ColorViewModel.FillColor.Color = Colors.Transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user