mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-07 09:46:37 +08:00
mind多个根节点的时候,切换模式的修复
This commit is contained in:
@@ -40,10 +40,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
protected override void InitNew()
|
||||
{
|
||||
connectors.Add(new FullyCreatedConnectorInfo(this.Root, this, ConnectorOrientation.Top));
|
||||
connectors.Add(new FullyCreatedConnectorInfo(this.Root, this, ConnectorOrientation.Bottom));
|
||||
connectors.Add(new FullyCreatedConnectorInfo(this.Root, this, ConnectorOrientation.Left));
|
||||
connectors.Add(new FullyCreatedConnectorInfo(this.Root, this, ConnectorOrientation.Right));
|
||||
AddConnector(new FullyCreatedConnectorInfo(this.Root, this, ConnectorOrientation.Top));
|
||||
AddConnector(new FullyCreatedConnectorInfo(this.Root, this, ConnectorOrientation.Bottom));
|
||||
AddConnector(new FullyCreatedConnectorInfo(this.Root, this, ConnectorOrientation.Left));
|
||||
AddConnector(new FullyCreatedConnectorInfo(this.Root, this, ConnectorOrientation.Right));
|
||||
}
|
||||
|
||||
protected override void LoadDesignerItemViewModel(SelectableItemBase designerbase)
|
||||
@@ -221,7 +221,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
RaisePropertyChanged(nameof(PhysicalItemHeight));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[DisplayName("ItemWidth(mm)")]
|
||||
[Browsable(true)]
|
||||
@@ -265,6 +265,19 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
private double _connectorMargin = -4;
|
||||
public double ConnectorMargin
|
||||
{
|
||||
get
|
||||
{
|
||||
return _connectorMargin;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _connectorMargin, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _showConnectors = false;
|
||||
public bool ShowConnectors
|
||||
{
|
||||
@@ -573,6 +586,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
if (!connectors.Contains(connector))
|
||||
{
|
||||
connectors.Add(connector);
|
||||
ConnectorMargin = 0 - connector.ConnectorWidth / 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1050,10 +1050,12 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
Mediator.Instance.Register(this);
|
||||
Items.CollectionChanged += Items_CollectionChanged;
|
||||
|
||||
var zoomValueChangedSubscription = WhenPropertyChanged.Where(o => o.ToString() == nameof(ZoomValue)).Throttle(TimeSpan.FromMilliseconds(100)).Subscribe(OnZoomValueChanged);//Sample
|
||||
|
||||
this.PropertyChanged += DiagramViewModel_PropertyChanged;
|
||||
BuildMenuOptions();
|
||||
}
|
||||
|
||||
public DiagramViewModel(DiagramItem diagramItem) : this()
|
||||
{
|
||||
DiagramType = diagramItem.DiagramType;
|
||||
@@ -1161,6 +1163,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
#endregion
|
||||
|
||||
#region 属性改变
|
||||
protected virtual void DiagramViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
if (e.OldItems != null)
|
||||
|
||||
Reference in New Issue
Block a user