mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
彩色连接点完成
This commit is contained in:
@@ -73,55 +73,6 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
get; private set;
|
||||
}
|
||||
|
||||
private bool _isSelected;
|
||||
[Browsable(false)]
|
||||
public override bool IsSelected
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isSelected;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _isSelected, value))
|
||||
{
|
||||
//如果没有文字,失去焦点自动清除
|
||||
if (_isSelected == false && string.IsNullOrEmpty(Text))
|
||||
{
|
||||
ShowText = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private string _text;
|
||||
[Browsable(true)]
|
||||
[CanDo]
|
||||
public override string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
var text = _text;
|
||||
if (FontViewModel.FontCase == FontCase.Upper)
|
||||
{
|
||||
return text?.ToUpper();
|
||||
}
|
||||
else if (FontViewModel.FontCase == FontCase.Lower)
|
||||
{
|
||||
return text?.ToLower();
|
||||
}
|
||||
else
|
||||
{
|
||||
return text;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _text, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isReadOnlyText = false;
|
||||
public bool IsReadOnlyText
|
||||
{
|
||||
@@ -137,8 +88,22 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
//自己定义文本显示,文本框不显示
|
||||
private bool _customText = false;
|
||||
public bool CustomText
|
||||
{
|
||||
get
|
||||
{
|
||||
return _customText;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _customText, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _showText;
|
||||
public virtual bool ShowText
|
||||
public bool ShowText
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -153,6 +118,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ClearText()
|
||||
{
|
||||
ShowText = false;
|
||||
}
|
||||
|
||||
private void ExecuteSelectItemCommand(object param)
|
||||
{
|
||||
SelectItem((bool)param, !IsSelected);
|
||||
@@ -164,7 +134,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
foreach (var designerItemViewModelBase in Root.SelectedItems.ToList())
|
||||
{
|
||||
designerItemViewModelBase._isSelected = false;
|
||||
designerItemViewModelBase.ClearSelected();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user