mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
补充提交
This commit is contained in:
@@ -138,10 +138,6 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
itemBase.ItemHeight = Math.Abs(this.endPoint.Value.Y - this.startPoint.Value.Y);
|
||||
|
||||
_viewModel.AddItemCommand.Execute(itemBase);
|
||||
|
||||
this.Dispatcher.BeginInvoke((System.Action)(() => {
|
||||
itemBase.ShowText = true;
|
||||
}));
|
||||
}
|
||||
else if (this._service.DrawModeViewModel.GetDrawMode() == DrawMode.Polyline
|
||||
|| this._service.DrawModeViewModel.GetDrawMode() == DrawMode.Polygon
|
||||
|
||||
@@ -18,7 +18,6 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
/// </summary>
|
||||
public partial class TextControl : UserControl
|
||||
{
|
||||
|
||||
public TextControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -63,7 +62,18 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
if (e.PropertyName == "IsSelected")
|
||||
{
|
||||
if (selectable.IsSelected == false)
|
||||
if (selectable.StartEditing)
|
||||
{
|
||||
selectable.StartEditing = false;
|
||||
PART_ShowText.Visibility = Visibility.Visible;
|
||||
PART_TextBlock.Visibility = Visibility.Collapsed;
|
||||
PART_ShowText.Focus();
|
||||
if (!string.IsNullOrEmpty(PART_ShowText.Text))
|
||||
{
|
||||
PART_ShowText.SelectionStart = PART_ShowText.Text.Length;
|
||||
}
|
||||
}
|
||||
else if (selectable.IsSelected == false)
|
||||
{
|
||||
PART_ShowText.Visibility = Visibility.Collapsed;
|
||||
PART_TextBlock.Visibility = Visibility.Visible;
|
||||
|
||||
@@ -178,6 +178,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public bool StartEditing
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
private bool _isEditing = false;
|
||||
public bool IsEditing
|
||||
{
|
||||
|
||||
@@ -45,8 +45,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
protected override void InitNew()
|
||||
{
|
||||
this.ItemWidth = 150;
|
||||
this.ClearConnectors();
|
||||
ShowText = true;
|
||||
this.StartEditing = true;
|
||||
}
|
||||
|
||||
private string _watermark = "请输入文本";
|
||||
|
||||
@@ -23,6 +23,12 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
get; set;
|
||||
}
|
||||
|
||||
//新建完处于编辑状态
|
||||
bool StartEditing
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
bool ShowText
|
||||
{
|
||||
get; set;
|
||||
|
||||
Reference in New Issue
Block a user