mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
60 lines
1.2 KiB
C#
60 lines
1.2 KiB
C#
|
|
using Util.DiagramDesigner;
|
|||
|
|
using System.Windows.Media;
|
|||
|
|
|
|||
|
|
namespace Util.DiagramDesigner
|
|||
|
|
{
|
|||
|
|
public class TextDesignerItemViewModel : DesignerItemViewModelBase
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
public TextDesignerItemViewModel(IDiagramViewModel parent, DesignerItemBase designer) : base(parent, designer)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public TextDesignerItemViewModel()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
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);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|