适应窗口大小完成

This commit is contained in:
艾竹
2023-03-12 22:47:45 +08:00
parent e2753b0bff
commit f22d6dd3f1
18 changed files with 280 additions and 42 deletions

View File

@@ -0,0 +1,38 @@
using System;
using System.Windows;
namespace AIStudio.Wpf.DiagramDesigner
{
public class LinkPointDesignerItemViewModel : DesignerItemViewModelBase
{
public LinkPointDesignerItemViewModel(Point location) : this(null, location)
{
}
public LinkPointDesignerItemViewModel(IDiagramViewModel root, Point location) : base(root)
{
Left = Math.Max(0, location.X - ItemWidth / 2);
Top = Math.Max(0, location.Y - ItemHeight / 2);
}
protected override void Init(IDiagramViewModel root)
{
base.Init(root);
this.ClearConnectors();
this.AddConnector(new FullyCreatedConnectorInfo(this, ConnectorOrientation.None, true));
ItemWidth = 5;
ItemHeight = 5;
}
public Point CurrentLocation
{
get
{
return new Point() { X = Left + ItemWidth / 2, Y = Top + ItemHeight / 2 };
}
}
}
}