diff --git a/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/ConnectionViewModel.cs b/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/ConnectionViewModel.cs index aef7635..497a74e 100644 --- a/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/ConnectionViewModel.cs +++ b/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/ConnectionViewModel.cs @@ -129,6 +129,10 @@ namespace AIStudio.Wpf.DiagramDesigner AddLabel(_text); } } + else + { + DeleteLabel(); + } } } } @@ -791,7 +795,10 @@ namespace AIStudio.Wpf.DiagramDesigner label.UpdatePosition(paths); } - + public void DeleteLabel() + { + Labels?.Clear(); + } #endregion } } diff --git a/AIStudio.Wpf.DiagramModels/DiagramDataConverter.cs b/AIStudio.Wpf.DiagramModels/DiagramDataConverter.cs index e564fde..7cbe782 100644 --- a/AIStudio.Wpf.DiagramModels/DiagramDataConverter.cs +++ b/AIStudio.Wpf.DiagramModels/DiagramDataConverter.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Windows.Media; using AIStudio.Wpf.DiagramDesigner; using AIStudio.Wpf.DiagramDesigner.Helpers; using Newtonsoft.Json; @@ -37,9 +38,10 @@ namespace AIStudio.Wpf.DiagramModels protected override DiagramLink Create(Type objectType, JObject jObject) { //第一种方法:判断属性值来确认是哪个派生类 - if (FieldExists("Type", jObject, out string type)) + if (FieldExists("Type", jObject, out string typename)) { - return new DiagramLink(); + var type = TypeHelper.GetType(typename); + return type != null ? (System.Activator.CreateInstance(type) as DiagramLink) : new DiagramLink(); } else { diff --git a/AIStudio.Wpf.Mind/Controls/DropDownButton.xaml b/AIStudio.Wpf.Mind/Controls/DropDownButton.xaml index fe019b9..4538d5d 100644 --- a/AIStudio.Wpf.Mind/Controls/DropDownButton.xaml +++ b/AIStudio.Wpf.Mind/Controls/DropDownButton.xaml @@ -48,7 +48,7 @@ - - + + + + + + + +