mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-14 21:46:37 +08:00
最近精简代码,有些bug,修复
This commit is contained in:
@@ -59,9 +59,9 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
private void TextControl_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "IsSelected")
|
||||
if (sender is ISelectable selectable)
|
||||
{
|
||||
if (sender is ISelectable selectable)
|
||||
if (e.PropertyName == "IsSelected")
|
||||
{
|
||||
if (selectable.IsSelected == false)
|
||||
{
|
||||
@@ -70,16 +70,16 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
selectable.IsEditing = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.PropertyName == "ShowText")
|
||||
{
|
||||
PART_ShowText.Visibility = Visibility.Visible;
|
||||
PART_TextBlock.Visibility = Visibility.Collapsed;
|
||||
PART_ShowText.Focus();
|
||||
if (!string.IsNullOrEmpty(PART_ShowText.Text))
|
||||
else if (e.PropertyName == "ShowText")
|
||||
{
|
||||
PART_ShowText.SelectionStart = PART_ShowText.Text.Length;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user