mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-11 12:10:49 +08:00
可以自定义连接点
This commit is contained in:
@@ -43,6 +43,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
ConnectorHeight = 30;
|
||||
|
||||
DeleteLabelCommand = new SimpleCommand(Command_Enable, DeleteLabel);
|
||||
EditCommand = new SimpleCommand(Command_Enable, ExecuteEditCommand);
|
||||
}
|
||||
|
||||
protected override void LoadDesignerItemViewModel(SelectableItemBase designerbase)
|
||||
@@ -81,7 +82,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
get; set;
|
||||
}
|
||||
|
||||
//private bool _isSelected;
|
||||
private bool _isSelected;
|
||||
public override bool IsSelected
|
||||
{
|
||||
get
|
||||
@@ -106,6 +107,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public SimpleCommand EditCommand
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
#endregion
|
||||
|
||||
private bool updating = false;
|
||||
@@ -198,5 +204,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void ExecuteEditCommand(object param)
|
||||
{
|
||||
if (IsReadOnly == true) return;
|
||||
|
||||
RaisePropertyChanged("ShowText");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,7 +297,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool CanAttachTo(FullyCreatedConnectorInfo port) => port != this && !port.IsReadOnly && DataItem != port.DataItem;
|
||||
public virtual bool CanAttachTo(FullyCreatedConnectorInfo port)
|
||||
=> port != this && !port.IsReadOnly && DataItem != port.DataItem;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -118,13 +118,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _text, value))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_text))
|
||||
{
|
||||
ShowText = true;
|
||||
}
|
||||
}
|
||||
SetProperty(ref _text, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +146,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _showText, value);
|
||||
if (!SetProperty(ref _showText, value))
|
||||
{
|
||||
RaisePropertyChanged(nameof(ShowText));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,8 +188,6 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
if (IsReadOnly == true) return;
|
||||
|
||||
ShowText = true;
|
||||
|
||||
RaisePropertyChanged("EditText");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
get; set;
|
||||
}
|
||||
|
||||
protected bool _isSelected;
|
||||
private bool _isSelected;
|
||||
[Browsable(false)]
|
||||
public virtual bool IsSelected
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user