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 @@
-
-
+
\ No newline at end of file
diff --git a/AIStudio.Wpf.Mind/Controls/PriorityControl.xaml b/AIStudio.Wpf.Mind/Controls/PriorityControl.xaml
index d691814..80588cf 100644
--- a/AIStudio.Wpf.Mind/Controls/PriorityControl.xaml
+++ b/AIStudio.Wpf.Mind/Controls/PriorityControl.xaml
@@ -1,12 +1,19 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AIStudio.Wpf.Mind/Controls/PriorityControl.xaml.cs b/AIStudio.Wpf.Mind/Controls/PriorityControl.xaml.cs
index 7a660b5..d72b68f 100644
--- a/AIStudio.Wpf.Mind/Controls/PriorityControl.xaml.cs
+++ b/AIStudio.Wpf.Mind/Controls/PriorityControl.xaml.cs
@@ -18,11 +18,20 @@ namespace AIStudio.Wpf.Mind.Controls
///
/// PriorityControl.xaml 的交互逻辑
///
- public partial class PriorityControl : UserControl
+ public class PriorityControl : Control
{
- public PriorityControl()
+
+ /// Identifies the dependency property.
+ public static readonly DependencyProperty PriorityProperty
+ = DependencyProperty.Register(nameof(Priority), typeof(double), typeof(PriorityControl));
+
+ ///
+ /// Whether or not the "popup" menu for this control is currently open
+ ///
+ public double Priority
{
- InitializeComponent();
+ get => (double)this.GetValue(PriorityProperty);
+ set => this.SetValue(PriorityProperty, (double)value);
}
}
}
diff --git a/AIStudio.Wpf.Mind/Controls/RateControl.xaml b/AIStudio.Wpf.Mind/Controls/RateControl.xaml
index a3b54ad..8494db3 100644
--- a/AIStudio.Wpf.Mind/Controls/RateControl.xaml
+++ b/AIStudio.Wpf.Mind/Controls/RateControl.xaml
@@ -1,12 +1,19 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AIStudio.Wpf.Mind/Controls/RateControl.xaml.cs b/AIStudio.Wpf.Mind/Controls/RateControl.xaml.cs
index 10af967..6bb150f 100644
--- a/AIStudio.Wpf.Mind/Controls/RateControl.xaml.cs
+++ b/AIStudio.Wpf.Mind/Controls/RateControl.xaml.cs
@@ -18,11 +18,20 @@ namespace AIStudio.Wpf.Mind.Controls
///
/// RateControl.xaml 的交互逻辑
///
- public partial class RateControl : UserControl
+ public class RateControl : Control
{
- public RateControl()
+
+ /// Identifies the dependency property.
+ public static readonly DependencyProperty RateProperty
+ = DependencyProperty.Register(nameof(Rate), typeof(double), typeof(RateControl));
+
+ ///
+ /// Whether or not the "popup" menu for this control is currently open
+ ///
+ public double Rate
{
- InitializeComponent();
+ get => (double)this.GetValue(RateProperty);
+ set => this.SetValue(RateProperty, (double)value);
}
}
}
diff --git a/AIStudio.Wpf.Mind/Controls/RemarkControl.xaml b/AIStudio.Wpf.Mind/Controls/RemarkControl.xaml
index 16a56c3..94547c0 100644
--- a/AIStudio.Wpf.Mind/Controls/RemarkControl.xaml
+++ b/AIStudio.Wpf.Mind/Controls/RemarkControl.xaml
@@ -1,12 +1,19 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AIStudio.Wpf.Mind/Controls/RemarkControl.xaml.cs b/AIStudio.Wpf.Mind/Controls/RemarkControl.xaml.cs
index f75c3e4..92a96c4 100644
--- a/AIStudio.Wpf.Mind/Controls/RemarkControl.xaml.cs
+++ b/AIStudio.Wpf.Mind/Controls/RemarkControl.xaml.cs
@@ -18,11 +18,20 @@ namespace AIStudio.Wpf.Mind.Controls
///
/// RemarkControl.xaml 的交互逻辑
///
- public partial class RemarkControl : UserControl
+ public class RemarkControl : Control
{
- public RemarkControl()
+
+ /// Identifies the dependency property.
+ public static readonly DependencyProperty RemarkProperty
+ = DependencyProperty.Register(nameof(Remark), typeof(string), typeof(RemarkControl));
+
+ ///
+ /// Whether or not the "popup" menu for this control is currently open
+ ///
+ public string Remark
{
- InitializeComponent();
+ get => (string)this.GetValue(RemarkProperty);
+ set => this.SetValue(RemarkProperty, (string)value);
}
}
}
diff --git a/AIStudio.Wpf.Mind/Controls/TagControl.xaml b/AIStudio.Wpf.Mind/Controls/TagControl.xaml
index 61839a8..003847c 100644
--- a/AIStudio.Wpf.Mind/Controls/TagControl.xaml
+++ b/AIStudio.Wpf.Mind/Controls/TagControl.xaml
@@ -1,12 +1,19 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AIStudio.Wpf.Mind/Controls/TagControl.xaml.cs b/AIStudio.Wpf.Mind/Controls/TagControl.xaml.cs
index 236dd6b..30f6047 100644
--- a/AIStudio.Wpf.Mind/Controls/TagControl.xaml.cs
+++ b/AIStudio.Wpf.Mind/Controls/TagControl.xaml.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -18,11 +19,19 @@ namespace AIStudio.Wpf.Mind.Controls
///
/// TagControl.xaml 的交互逻辑
///
- public partial class TagControl : UserControl
+ public class TagControl : Control
{
- public TagControl()
+ /// Identifies the dependency property.
+ public static readonly DependencyProperty TagsProperty
+ = DependencyProperty.Register(nameof(Tags), typeof(ObservableCollection), typeof(TagControl));
+
+ ///
+ /// Whether or not the "popup" menu for this control is currently open
+ ///
+ public ObservableCollection Tags
{
- InitializeComponent();
+ get => (ObservableCollection)this.GetValue(TagsProperty);
+ set => this.SetValue(TagsProperty, (ObservableCollection)value);
}
}
}
diff --git a/AIStudio.Wpf.Mind/ViewModels/MindNode.cs b/AIStudio.Wpf.Mind/ViewModels/MindNode.cs
index 82d1790..bc9ca0a 100644
--- a/AIStudio.Wpf.Mind/ViewModels/MindNode.cs
+++ b/AIStudio.Wpf.Mind/ViewModels/MindNode.cs
@@ -265,29 +265,29 @@ namespace AIStudio.Wpf.Mind.ViewModels
}
}
- private string _grade;
- public string Grade
+ private double _priority;
+ public double Priority
{
get
{
- return _grade;
+ return _priority;
}
set
{
- SetProperty(ref _grade, value);
+ SetProperty(ref _priority, value);
}
}
- private double _completionRate;
- public double CompletionRate
+ private double _rate;
+ public double Rate
{
get
{
- return _completionRate;
+ return _rate;
}
set
{
- SetProperty(ref _completionRate, value);
+ SetProperty(ref _rate, value);
}
}