Files
aistudio-wpf-diagram/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/ConnectorInfoBase.cs

97 lines
2.2 KiB
C#
Raw Normal View History

2021-07-23 09:42:22 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
2023-01-12 23:02:53 +08:00
using AIStudio.Wpf.DiagramDesigner.Geometrys;
2021-07-23 09:42:22 +08:00
2022-10-28 22:45:39 +08:00
namespace AIStudio.Wpf.DiagramDesigner
2021-07-23 09:42:22 +08:00
{
2023-01-24 16:20:39 +08:00
public abstract class ConnectorInfoBase : SelectableViewModelBase
2021-07-23 09:42:22 +08:00
{
2023-01-24 16:20:39 +08:00
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
2023-01-15 20:27:39 +08:00
public virtual PointBase Position
2023-01-08 09:22:37 +08:00
{
2023-01-15 20:27:39 +08:00
get;
}
public virtual PointBase MiddlePosition
{
get
{
return new PointBase(Position.X + ConnectorWidth / 2, Position.Y + ConnectorHeight / 2);
}
2023-01-24 16:20:39 +08:00
}
2021-07-23 09:42:22 +08:00
private ConnectorOrientation _orientation;
public ConnectorOrientation Orientation
{
2023-01-08 09:22:37 +08:00
get
{
return _orientation;
}
2021-07-23 09:42:22 +08:00
set
{
SetProperty(ref _orientation, value);
}
}
private double connectorWidth = 8;
public double ConnectorWidth
{
2023-01-08 09:22:37 +08:00
get
{
return connectorWidth;
}
set
{
connectorWidth = value;
}
2021-07-23 09:42:22 +08:00
}
private double connectorHeight = 8;
public double ConnectorHeight
{
2023-01-08 09:22:37 +08:00
get
{
return connectorHeight;
}
set
{
connectorHeight = value;
}
2021-07-23 09:42:22 +08:00
}
public double _connectorValue;
public double ConnectorValue
{
get
{
return _connectorValue;
}
set
{
SetProperty(ref _connectorValue, value);
}
2023-01-08 09:22:37 +08:00
}
2023-01-24 16:20:39 +08:00
#endregion
2021-07-23 09:42:22 +08:00
}
}