mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
70 lines
1.5 KiB
C#
70 lines
1.5 KiB
C#
using AIStudio.Wpf.DiagramDesigner;
|
|
using System.Windows.Media;
|
|
|
|
namespace AIStudio.Wpf.DiagramDesigner
|
|
{
|
|
public class TextDesignerItemViewModel : DesignerItemViewModelBase
|
|
{
|
|
public TextDesignerItemViewModel()
|
|
{
|
|
|
|
}
|
|
|
|
public TextDesignerItemViewModel(IDiagramViewModel parent, DesignerItemBase designer) : base(parent, designer)
|
|
{
|
|
|
|
}
|
|
|
|
public TextDesignerItemViewModel(IDiagramViewModel parent, string json) : base(parent, json)
|
|
{
|
|
|
|
}
|
|
|
|
|
|
public override SelectableDesignerItemBase ToXmlObject()
|
|
{
|
|
return new TextDesignerItem(this);
|
|
}
|
|
|
|
protected override void Init()
|
|
{
|
|
base.Init();
|
|
|
|
this.ItemWidth = 150;
|
|
this.ClearConnectors();
|
|
}
|
|
|
|
protected override void ExecuteEditCommand(object param)
|
|
{
|
|
if (IsReadOnly == true) return;
|
|
}
|
|
|
|
private string _watermark = "请输入文本";
|
|
public string Watermark
|
|
{
|
|
get
|
|
{
|
|
return _watermark;
|
|
}
|
|
set
|
|
{
|
|
SetProperty(ref _watermark, value);
|
|
}
|
|
}
|
|
|
|
//固定在DataTemplate中处理
|
|
private bool _showText;
|
|
public override bool ShowText
|
|
{
|
|
get
|
|
{
|
|
return false;
|
|
}
|
|
set
|
|
{
|
|
SetProperty(ref _showText, value);
|
|
}
|
|
}
|
|
}
|
|
}
|