附加信息准备中

This commit is contained in:
kwai
2023-03-13 19:44:30 +08:00
parent 414eb28867
commit 31872222bc
12 changed files with 146 additions and 73 deletions

View File

@@ -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
}
}

View File

@@ -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
{

View File

@@ -48,7 +48,7 @@
</Style>
<Style x:Key="AIStudio.Styles.DropDownButton" TargetType="{x:Type controls:DropDownButton}">
<Style x:Key="DropDownButtonStyle" TargetType="{x:Type controls:DropDownButton}">
<Setter Property="ArrowBrush" Value="Black" />
<Setter Property="ArrowMouseOverBrush"
Value="{Binding Foreground, RelativeSource={RelativeSource Mode=Self},
@@ -208,6 +208,6 @@
</Style.Triggers>
</Style>
<Style TargetType="{x:Type controls:DropDownButton}" BasedOn="{StaticResource AIStudio.Styles.DropDownButton}" />
<Style TargetType="{x:Type controls:DropDownButton}" BasedOn="{StaticResource DropDownButtonStyle}" />
</ResourceDictionary>

View File

@@ -1,12 +1,19 @@
<UserControl x:Class="AIStudio.Wpf.Mind.Controls.PriorityControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:AIStudio.Wpf.Mind.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:AIStudio.Wpf.Mind.Controls">
<Style x:Key="PriorityControlStyle" TargetType="{x:Type controls:PriorityControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:PriorityControl}">
<Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type controls:PriorityControl}" BasedOn="{StaticResource PriorityControlStyle}" />
</ResourceDictionary>

View File

@@ -18,11 +18,20 @@ namespace AIStudio.Wpf.Mind.Controls
/// <summary>
/// PriorityControl.xaml 的交互逻辑
/// </summary>
public partial class PriorityControl : UserControl
public class PriorityControl : Control
{
public PriorityControl()
/// <summary>Identifies the <see cref="Priority"/> dependency property.</summary>
public static readonly DependencyProperty PriorityProperty
= DependencyProperty.Register(nameof(Priority), typeof(double), typeof(PriorityControl));
/// <summary>
/// Whether or not the "popup" menu for this control is currently open
/// </summary>
public double Priority
{
InitializeComponent();
get => (double)this.GetValue(PriorityProperty);
set => this.SetValue(PriorityProperty, (double)value);
}
}
}

View File

@@ -1,12 +1,19 @@
<UserControl x:Class="AIStudio.Wpf.Mind.Controls.RateControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:AIStudio.Wpf.Mind.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:AIStudio.Wpf.Mind.Controls">
<Style x:Key="RateControlStyle" TargetType="{x:Type controls:RateControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:RateControl}">
<Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type controls:RateControl}" BasedOn="{StaticResource RateControlStyle}" />
</ResourceDictionary>

View File

@@ -18,11 +18,20 @@ namespace AIStudio.Wpf.Mind.Controls
/// <summary>
/// RateControl.xaml 的交互逻辑
/// </summary>
public partial class RateControl : UserControl
public class RateControl : Control
{
public RateControl()
/// <summary>Identifies the <see cref="Rate"/> dependency property.</summary>
public static readonly DependencyProperty RateProperty
= DependencyProperty.Register(nameof(Rate), typeof(double), typeof(RateControl));
/// <summary>
/// Whether or not the "popup" menu for this control is currently open
/// </summary>
public double Rate
{
InitializeComponent();
get => (double)this.GetValue(RateProperty);
set => this.SetValue(RateProperty, (double)value);
}
}
}

View File

@@ -1,12 +1,19 @@
<UserControl x:Class="AIStudio.Wpf.Mind.Controls.RemarkControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:AIStudio.Wpf.Mind.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:AIStudio.Wpf.Mind.Controls">
<Style x:Key="RemarkControlStyle" TargetType="{x:Type controls:RemarkControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:RemarkControl}">
<Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type controls:RemarkControl}" BasedOn="{StaticResource RemarkControlStyle}" />
</ResourceDictionary>

View File

@@ -18,11 +18,20 @@ namespace AIStudio.Wpf.Mind.Controls
/// <summary>
/// RemarkControl.xaml 的交互逻辑
/// </summary>
public partial class RemarkControl : UserControl
public class RemarkControl : Control
{
public RemarkControl()
/// <summary>Identifies the <see cref="Remark"/> dependency property.</summary>
public static readonly DependencyProperty RemarkProperty
= DependencyProperty.Register(nameof(Remark), typeof(string), typeof(RemarkControl));
/// <summary>
/// Whether or not the "popup" menu for this control is currently open
/// </summary>
public string Remark
{
InitializeComponent();
get => (string)this.GetValue(RemarkProperty);
set => this.SetValue(RemarkProperty, (string)value);
}
}
}

View File

@@ -1,12 +1,19 @@
<UserControl x:Class="AIStudio.Wpf.Mind.Controls.TagControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:AIStudio.Wpf.Mind.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:AIStudio.Wpf.Mind.Controls">
<Style x:Key="TagControlStyle" TargetType="{x:Type controls:TagControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:TagControl}">
<Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type controls:TagControl}" BasedOn="{StaticResource TagControlStyle}" />
</ResourceDictionary>

View File

@@ -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
/// <summary>
/// TagControl.xaml 的交互逻辑
/// </summary>
public partial class TagControl : UserControl
public class TagControl : Control
{
public TagControl()
/// <summary>Identifies the <see cref="Tags"/> dependency property.</summary>
public static readonly DependencyProperty TagsProperty
= DependencyProperty.Register(nameof(Tags), typeof(ObservableCollection<string>), typeof(TagControl));
/// <summary>
/// Whether or not the "popup" menu for this control is currently open
/// </summary>
public ObservableCollection<string> Tags
{
InitializeComponent();
get => (ObservableCollection<string>)this.GetValue(TagsProperty);
set => this.SetValue(TagsProperty, (ObservableCollection<string>)value);
}
}
}

View File

@@ -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);
}
}