mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
97 lines
2.2 KiB
C#
97 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows;
|
|
using System.Windows.Media;
|
|
using AIStudio.Wpf.DiagramDesigner.Geometrys;
|
|
|
|
namespace AIStudio.Wpf.DiagramDesigner
|
|
{
|
|
public abstract class ConnectorInfoBase : SelectableViewModelBase
|
|
{
|
|
public ConnectorInfoBase(ConnectorOrientation orientation)
|
|
{
|
|
this.Orientation = orientation;
|
|
}
|
|
|
|
protected override void Init()
|
|
{
|
|
base.Init();
|
|
|
|
ColorViewModel = new ColorViewModel()
|
|
{
|
|
LineColor = new ColorObject() { Color = Color.FromArgb(0xAA, 0x00, 0x00, 0x80) },
|
|
FillColor = new ColorObject() { Color = Colors.Lavender },
|
|
};
|
|
}
|
|
|
|
#region 属性
|
|
public virtual PointBase Position
|
|
{
|
|
get;
|
|
}
|
|
|
|
public virtual PointBase MiddlePosition
|
|
{
|
|
get
|
|
{
|
|
return new PointBase(Position.X + ConnectorWidth / 2, Position.Y + ConnectorHeight / 2);
|
|
}
|
|
}
|
|
|
|
private ConnectorOrientation _orientation;
|
|
public ConnectorOrientation Orientation
|
|
{
|
|
get
|
|
{
|
|
return _orientation;
|
|
}
|
|
set
|
|
{
|
|
SetProperty(ref _orientation, value);
|
|
}
|
|
}
|
|
|
|
private double connectorWidth = 8;
|
|
public double ConnectorWidth
|
|
{
|
|
get
|
|
{
|
|
return connectorWidth;
|
|
}
|
|
set
|
|
{
|
|
connectorWidth = value;
|
|
}
|
|
}
|
|
|
|
private double connectorHeight = 8;
|
|
public double ConnectorHeight
|
|
{
|
|
get
|
|
{
|
|
return connectorHeight;
|
|
}
|
|
set
|
|
{
|
|
connectorHeight = value;
|
|
}
|
|
}
|
|
|
|
public double _connectorValue;
|
|
public double ConnectorValue
|
|
{
|
|
get
|
|
{
|
|
return _connectorValue;
|
|
}
|
|
set
|
|
{
|
|
SetProperty(ref _connectorValue, value);
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|