mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-08 18:26:35 +08:00
线条动画支持大小切换
This commit is contained in:
@@ -76,42 +76,42 @@ namespace AIStudio.Wpf.Logical
|
||||
|
||||
ConnectionViewModel connector1 = new ConnectionViewModel(in1.Output[0], item1.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector1.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector1.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
connector1.AnimationViewModel.Animation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector1);
|
||||
|
||||
ConnectionViewModel connector2 = new ConnectionViewModel(in2.Output[0], item1.Input[1], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector2.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector2.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
connector2.AnimationViewModel.Animation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector2);
|
||||
|
||||
ConnectionViewModel connector3 = new ConnectionViewModel(item1.Output[0], gTGate.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector3.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector3.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
connector3.AnimationViewModel.Animation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector3);
|
||||
|
||||
ConnectionViewModel connector4 = new ConnectionViewModel(constant.Output[0], gTGate.Input[1], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector4.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector4.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
connector4.AnimationViewModel.Animation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector4);
|
||||
|
||||
ConnectionViewModel connector5 = new ConnectionViewModel(gTGate.Output[0], sELGate.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector5.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector5.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
connector5.AnimationViewModel.Animation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector5);
|
||||
|
||||
ConnectionViewModel connector6 = new ConnectionViewModel(in3.Output[0], sELGate.Input[1], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector6.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector6.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
connector6.AnimationViewModel.Animation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector6);
|
||||
|
||||
ConnectionViewModel connector7 = new ConnectionViewModel(in4.Output[0], sELGate.Input[2], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector7.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector7.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
connector7.AnimationViewModel.Animation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector7);
|
||||
|
||||
ConnectionViewModel connector8 = new ConnectionViewModel(sELGate.Output[0], out1.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector8.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector8.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
connector8.AnimationViewModel.Animation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector8);
|
||||
}
|
||||
|
||||
|
||||
@@ -447,6 +447,10 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
{
|
||||
PageViewModel.DiagramViewModel.SetSharp(sender as IShapeViewModel, e.PropertyName, PageViewModel.DiagramViewModel.SelectedItems);
|
||||
}
|
||||
else if (sender is IAnimationViewModel)
|
||||
{
|
||||
PageViewModel.DiagramViewModel.SetAnimation(sender as IAnimationViewModel, e.PropertyName, PageViewModel.DiagramViewModel.SelectedItems);
|
||||
}
|
||||
else if (sender is IQuickThemeViewModel)
|
||||
{
|
||||
PageViewModel.DiagramViewModel.SetQuickItem(sender as IQuickThemeViewModel, e.PropertyName, PageViewModel.DiagramViewModel.SelectedItems);
|
||||
|
||||
@@ -1169,7 +1169,7 @@
|
||||
<StackPanel>
|
||||
<TextBlock Text="箭头样式" Margin="5"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:ArrowPathStyle}" SelectedItem="{Binding ShapeViewModel.SourceMarker.PathStyle}">
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:PathStyle}" SelectedItem="{Binding ShapeViewModel.SourceMarker.PathStyle}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel>
|
||||
@@ -1196,7 +1196,7 @@
|
||||
</Fluent:ComboBox.ItemTemplate>
|
||||
</Fluent:ComboBox>
|
||||
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:ArrowPathStyle}" SelectedItem="{Binding ShapeViewModel.SinkMarker.PathStyle}">
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:PathStyle}" SelectedItem="{Binding ShapeViewModel.SinkMarker.PathStyle}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel>
|
||||
@@ -1233,14 +1233,14 @@
|
||||
<StackPanel>
|
||||
<TextBlock Text="箭头样式" Margin="5"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:ArrowSizeStyle}" SelectedItem="{Binding ShapeViewModel.SourceMarker.SizeStyle}">
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:SizeStyle}" SelectedItem="{Binding ShapeViewModel.SourceMarker.SizeStyle}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
</DataTemplate>
|
||||
</Fluent:ComboBox.ItemTemplate>
|
||||
</Fluent:ComboBox>
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:ArrowSizeStyle}" SelectedItem="{Binding ShapeViewModel.SinkMarker.SizeStyle}">
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:SizeStyle}" SelectedItem="{Binding ShapeViewModel.SinkMarker.SizeStyle}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
@@ -1268,7 +1268,7 @@
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="线条动画" Margin="5"/>
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:LineAnimation}" SelectedItem="{Binding AnimationViewModel.LineAnimation}">
|
||||
<Fluent:ComboBox Size="Small" Width="140" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:LineAnimation}" SelectedItem="{Binding AnimationViewModel.Animation}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
@@ -1276,6 +1276,43 @@
|
||||
</Fluent:ComboBox.ItemTemplate>
|
||||
</Fluent:ComboBox>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Text="动画样式" Margin="5"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Fluent:ComboBox Size="Small" Width="60" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:PathStyle}" SelectedItem="{Binding AnimationViewModel.AnimationPath.PathStyle}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel>
|
||||
<Grid>
|
||||
<Path
|
||||
Data="{Binding .,Converter={StaticResource ArrowPathConverter}}"
|
||||
HorizontalAlignment="Left"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Stretch="Fill"
|
||||
Stroke="Black"
|
||||
Fill="Black"
|
||||
VerticalAlignment="Center"
|
||||
RenderTransformOrigin="0.5,0.5">
|
||||
<Path.RenderTransform>
|
||||
<RotateTransform x:Name="rightrot" Angle="180" />
|
||||
</Path.RenderTransform>
|
||||
</Path>
|
||||
</Grid>
|
||||
<TextBlock DockPanel.Dock="Right" Margin="2,0" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplatedParent.(ItemsControl.AlternationIndex),Converter={StaticResource NumberConverter}}"></TextBlock>
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
</Fluent:ComboBox.ItemTemplate>
|
||||
</Fluent:ComboBox>
|
||||
<Fluent:ComboBox Size="Small" Width="70" Margin="5" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:SizeStyle}" SelectedItem="{Binding AnimationViewModel.AnimationPath.SizeStyle}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
</DataTemplate>
|
||||
</Fluent:ComboBox.ItemTemplate>
|
||||
</Fluent:ComboBox>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Fluent:DropDownButton.ToolTip>
|
||||
<Fluent:ScreenTip Title="LineStyle"
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
if (value is ArrowPathStyle arrowStyle)
|
||||
if (value is PathStyle arrowStyle)
|
||||
{
|
||||
return ArrowPathData.Arrow[arrowStyle];
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
if (value is ArrowSizeStyle arrowStyle)
|
||||
if (value is SizeStyle arrowStyle)
|
||||
{
|
||||
return (int)arrowStyle;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Text;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public enum ArrowPathStyle
|
||||
public enum PathStyle
|
||||
{
|
||||
None,
|
||||
Arrow,
|
||||
@@ -5,7 +5,7 @@ using System.Text;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public enum ArrowSizeStyle
|
||||
public enum SizeStyle
|
||||
{
|
||||
[Description("非常小")]
|
||||
VerySmall = 6,
|
||||
@@ -223,12 +223,14 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
public static IAnimationViewModel Mapper(IAnimationViewModel s)
|
||||
{
|
||||
var d = CopyHelper.Mapper<AnimationViewModel, IAnimationViewModel>(s);
|
||||
d.AnimationPath = CopyHelper.Mapper<SharpPath, ISharpPath>(s.AnimationPath);
|
||||
return d;
|
||||
}
|
||||
|
||||
public static T Mapper<T>(IAnimationViewModel s) where T : IAnimationViewModel
|
||||
{
|
||||
var d = CopyHelper.Mapper<T, IAnimationViewModel>(s);
|
||||
d.AnimationPath = CopyHelper.Mapper<SharpPathItem, ISharpPath>(s.AnimationPath);
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
@@ -419,7 +419,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
public class AnimationItem : IAnimationViewModel
|
||||
{
|
||||
[XmlAttribute]
|
||||
public LineAnimation LineAnimation
|
||||
public LineAnimation Animation
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
@@ -434,7 +434,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
public Color Color
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
[XmlElement("Color")]
|
||||
@@ -450,22 +450,24 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public string Path
|
||||
[XmlIgnore]
|
||||
public ISharpPath AnimationPath
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public double Width
|
||||
[JsonIgnore]
|
||||
[XmlElement("AnimationPath")]
|
||||
public SharpPathItem XmlAnimationPath
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public double Height
|
||||
{
|
||||
get; set;
|
||||
get
|
||||
{
|
||||
return AnimationPath as SharpPathItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
AnimationPath = value;
|
||||
}
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
@@ -871,13 +873,13 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public ArrowPathStyle PathStyle
|
||||
public PathStyle PathStyle
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public ArrowSizeStyle SizeStyle
|
||||
public SizeStyle SizeStyle
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public class ArrowPathData
|
||||
{
|
||||
public static readonly Dictionary<ArrowPathStyle, string> Arrow = new Dictionary<ArrowPathStyle, string>()
|
||||
public static readonly Dictionary<PathStyle, string> Arrow = new Dictionary<PathStyle, string>()
|
||||
{
|
||||
{ ArrowPathStyle.None, "" },
|
||||
{ ArrowPathStyle.Arrow, "M 0 -5 10 0 0 5 z" },
|
||||
{ ArrowPathStyle.Circle, "M 0, 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0" },
|
||||
{ ArrowPathStyle.Square, "M 0 -5 10 -5 10 5 0 5 z" },
|
||||
{ PathStyle.None, "" },
|
||||
{ PathStyle.Arrow, "M 0 -5 10 0 0 5 z" },
|
||||
{ PathStyle.Circle, "M 0, 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0" },
|
||||
{ PathStyle.Square, "M 0 -5 10 -5 10 5 0 5 z" },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,10 +106,10 @@
|
||||
|
||||
<Path x:Name="ball"
|
||||
Stretch="Fill"
|
||||
Data="{Binding AnimationViewModel.Path}"
|
||||
Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}"
|
||||
Width="{Binding ColorViewModel.LineWidth,Converter={StaticResource MathAddConverter},ConverterParameter=4}"
|
||||
Height="{Binding ColorViewModel.LineWidth,Converter={StaticResource MathAddConverter},ConverterParameter=4}"
|
||||
Data="{Binding AnimationViewModel.AnimationPath.Path}"
|
||||
Fill="{Binding AnimationViewModel.Color,Converter={StaticResource ColorBrushConverter}}"
|
||||
Width="{Binding AnimationViewModel.AnimationPath.Width}"
|
||||
Height="{Binding ColorViewModel.AnimationPath.Height}"
|
||||
Panel.ZIndex="1" />
|
||||
</Canvas>
|
||||
</Grid>
|
||||
|
||||
@@ -30,16 +30,16 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
private void LineControl_Unloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is ConnectionViewModel connector && connector.ColorViewModel != null)
|
||||
if (this.DataContext is ConnectionViewModel connector && connector.AnimationViewModel != null)
|
||||
{
|
||||
connector.ColorViewModel.PropertyChanged -= Connector_PropertyChanged;
|
||||
connector.AnimationViewModel.PropertyChanged -= Connector_PropertyChanged;
|
||||
}
|
||||
_story?.Stop();
|
||||
}
|
||||
|
||||
private async void PathAnimation_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is ConnectionViewModel connector && connector.ColorViewModel != null)
|
||||
if (this.DataContext is ConnectionViewModel connector && connector.AnimationViewModel != null)
|
||||
{
|
||||
connector.AnimationViewModel.PropertyChanged -= Connector_PropertyChanged;
|
||||
connector.AnimationViewModel.PropertyChanged += Connector_PropertyChanged;
|
||||
@@ -52,7 +52,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
switch (e.PropertyName)
|
||||
{
|
||||
case nameof(AnimationViewModel.LineAnimation):
|
||||
case nameof(AnimationViewModel.Animation):
|
||||
case nameof(AnimationViewModel.Duration):
|
||||
await DoAnimation();
|
||||
break;
|
||||
@@ -65,7 +65,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
if (this.DataContext is ConnectionViewModel connector && connector.IsFullConnection)
|
||||
{
|
||||
await System.Threading.Tasks.Task.Delay(100);
|
||||
switch (connector.AnimationViewModel.LineAnimation)
|
||||
switch (connector.AnimationViewModel.Animation)
|
||||
{
|
||||
case LineAnimation.None:
|
||||
_story?.Stop(this);
|
||||
|
||||
@@ -6,17 +6,17 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
[Serializable]
|
||||
public class AnimationViewModel : BindableBase, IAnimationViewModel
|
||||
{
|
||||
private LineAnimation _lineAnimation = LineAnimation.None;
|
||||
private LineAnimation _animation = LineAnimation.None;
|
||||
[CanDo]
|
||||
public LineAnimation LineAnimation
|
||||
public LineAnimation Animation
|
||||
{
|
||||
get
|
||||
{
|
||||
return _lineAnimation;
|
||||
return _animation;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _lineAnimation, value);
|
||||
SetProperty(ref _animation, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
SetProperty(ref _duration, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Color _color = Colors.Red;
|
||||
[CanDo]
|
||||
@@ -51,45 +51,39 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
private string _path = "M 10,20 A 20,20 0 1 1 50,20 A 20,20 0 1 1 10,20";
|
||||
[CanDo]
|
||||
public string Path
|
||||
private ISharpPath _animationPath = SharpPath.Circle;
|
||||
public ISharpPath AnimationPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return _path;
|
||||
return _animationPath;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _path, value);
|
||||
if (_animationPath != value)
|
||||
{
|
||||
if (_animationPath != null && _animationPath is SharpPath _sharpPath1)
|
||||
{
|
||||
_sharpPath1.PropertyChanged -= AnimationViewModel_PropertyChanged;
|
||||
}
|
||||
SetProperty(ref _animationPath, value);
|
||||
if (_animationPath != null && _animationPath is SharpPath _sharpPath2)
|
||||
{
|
||||
_sharpPath2.PropertyChanged += AnimationViewModel_PropertyChanged;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RaisePropertyChanged(nameof(AnimationPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private double _witdh;
|
||||
[CanDo]
|
||||
public double Width
|
||||
private void AnimationViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
get
|
||||
if (sender == AnimationPath)
|
||||
{
|
||||
return _witdh;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _witdh, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _height;
|
||||
[CanDo]
|
||||
public double Height
|
||||
{
|
||||
get
|
||||
{
|
||||
return _height;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _height, value);
|
||||
RaisePropertyChanged(nameof(AnimationPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public interface IAnimationViewModel
|
||||
{
|
||||
LineAnimation LineAnimation
|
||||
LineAnimation Animation
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
@@ -22,15 +22,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
string Path
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
double Width
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
double Height
|
||||
ISharpPath AnimationPath
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public interface ISharpPath
|
||||
{
|
||||
string Path
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
double Width
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
double Height
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
PathStyle PathStyle
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
SizeStyle SizeStyle
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,152 +75,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public class SharpPath : BindableBase, ISharpPath
|
||||
{
|
||||
public static SharpPath None { get; } = new SharpPath("", 10, 10, ArrowPathStyle.None, ArrowSizeStyle.Middle);
|
||||
public static SharpPath Arrow { get; } = new SharpPath("M 0 -5 10 0 0 5 z", 10, 10, ArrowPathStyle.Arrow, ArrowSizeStyle.Middle);
|
||||
public static SharpPath Circle { get; } = new SharpPath("M 0, 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0", 10, 10, ArrowPathStyle.Circle, ArrowSizeStyle.Middle);
|
||||
public static SharpPath Square { get; } = new SharpPath("M 0 -5 10 -5 10 5 0 5 z", 10, 10, ArrowPathStyle.Square, ArrowSizeStyle.Middle);
|
||||
|
||||
|
||||
public static readonly Dictionary<ArrowPathStyle, string> ArrowDictionary = new Dictionary<ArrowPathStyle, string>()
|
||||
{
|
||||
{ ArrowPathStyle.None, None.Path },
|
||||
{ ArrowPathStyle.Arrow, Arrow.Path },
|
||||
{ ArrowPathStyle.Circle, Circle.Path },
|
||||
{ ArrowPathStyle.Square, Square.Path },
|
||||
};
|
||||
|
||||
public SharpPath()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SharpPath(string path, double width, double height, ArrowPathStyle arrowPathStyle, ArrowSizeStyle arrowSizeStyle)
|
||||
{
|
||||
Path = path;
|
||||
Width = width;
|
||||
Height = height;
|
||||
_pathStyle = arrowPathStyle;
|
||||
_sizeStyle = arrowSizeStyle;
|
||||
}
|
||||
|
||||
private string _path;
|
||||
[CanDo]
|
||||
public string Path
|
||||
{
|
||||
get
|
||||
{
|
||||
return _path;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _path, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _witdh;
|
||||
[CanDo]
|
||||
public double Width
|
||||
{
|
||||
get
|
||||
{
|
||||
return _witdh;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _witdh, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _height;
|
||||
[CanDo]
|
||||
public double Height
|
||||
{
|
||||
get
|
||||
{
|
||||
return _height;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _height, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ArrowPathStyle _pathStyle = ArrowPathStyle.None;
|
||||
[CanDo]
|
||||
public ArrowPathStyle PathStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
return _pathStyle;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _pathStyle, value))
|
||||
{
|
||||
if (ArrowDictionary.ContainsKey(_pathStyle))
|
||||
{
|
||||
Path = ArrowDictionary[_pathStyle];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ArrowSizeStyle _sizeStyle = ArrowSizeStyle.Middle;
|
||||
[CanDo]
|
||||
public ArrowSizeStyle SizeStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
return _sizeStyle;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _sizeStyle, value))
|
||||
{
|
||||
Width = (double)_sizeStyle;
|
||||
Height = (double)_sizeStyle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static SharpPath NewArrow(double width, double height)
|
||||
=> new SharpPath(FormattableString.Invariant($"M 0 -{height / 2} {width} 0 0 {height / 2}"), width, height, ArrowPathStyle.Arrow, (ArrowSizeStyle)width);
|
||||
|
||||
public static SharpPath NewCircle(double r)
|
||||
=> new SharpPath(FormattableString.Invariant($"M 0, 0 a {r},{r} 0 1,0 {r * 2},0 a {r},{r} 0 1,0 -{r * 2},0"), r * 2, r * 2, ArrowPathStyle.Circle, (ArrowSizeStyle)(r * 2));
|
||||
|
||||
public static SharpPath NewRectangle(double width, double height)
|
||||
=> new SharpPath(FormattableString.Invariant($"M 0 -{height / 2} {width} -{height / 2} {width} {height / 2} 0 {height / 2} z"), width, height, ArrowPathStyle.Square, (ArrowSizeStyle)width);
|
||||
|
||||
public static SharpPath NewSquare(double size) => NewRectangle(size, size);
|
||||
}
|
||||
|
||||
public interface ISharpPath
|
||||
{
|
||||
string Path
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
double Width
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
double Height
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
ArrowPathStyle PathStyle
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
ArrowSizeStyle SizeStyle
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public class SharpPath : BindableBase, ISharpPath
|
||||
{
|
||||
public static SharpPath None { get; } = new SharpPath("", 10, 10, PathStyle.None, SizeStyle.Middle);
|
||||
public static SharpPath Arrow { get; } = new SharpPath("M 0 -5 10 0 0 5 z", 10, 10, PathStyle.Arrow, SizeStyle.Middle);
|
||||
public static SharpPath Circle { get; } = new SharpPath("M 0, 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0", 10, 10, PathStyle.Circle, SizeStyle.Middle);
|
||||
public static SharpPath Square { get; } = new SharpPath("M 0 -5 10 -5 10 5 0 5 z", 10, 10, PathStyle.Square, SizeStyle.Middle);
|
||||
|
||||
public static readonly Dictionary<PathStyle, string> ArrowDictionary = new Dictionary<PathStyle, string>()
|
||||
{
|
||||
{ PathStyle.None, None.Path },
|
||||
{ PathStyle.Arrow, Arrow.Path },
|
||||
{ PathStyle.Circle, Circle.Path },
|
||||
{ PathStyle.Square, Square.Path },
|
||||
};
|
||||
|
||||
public SharpPath()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SharpPath(string path, double width, double height, PathStyle arrowPathStyle, SizeStyle arrowSizeStyle)
|
||||
{
|
||||
Path = path;
|
||||
Width = width;
|
||||
Height = height;
|
||||
_pathStyle = arrowPathStyle;
|
||||
_sizeStyle = arrowSizeStyle;
|
||||
}
|
||||
|
||||
private string _path;
|
||||
[CanDo]
|
||||
public string Path
|
||||
{
|
||||
get
|
||||
{
|
||||
return _path;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _path, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _witdh;
|
||||
[CanDo]
|
||||
public double Width
|
||||
{
|
||||
get
|
||||
{
|
||||
return _witdh;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _witdh, value);
|
||||
}
|
||||
}
|
||||
|
||||
private double _height;
|
||||
[CanDo]
|
||||
public double Height
|
||||
{
|
||||
get
|
||||
{
|
||||
return _height;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _height, value);
|
||||
}
|
||||
}
|
||||
|
||||
private PathStyle _pathStyle = PathStyle.None;
|
||||
[CanDo]
|
||||
public PathStyle PathStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
return _pathStyle;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _pathStyle, value))
|
||||
{
|
||||
if (ArrowDictionary.ContainsKey(_pathStyle))
|
||||
{
|
||||
Path = ArrowDictionary[_pathStyle];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private SizeStyle _sizeStyle = SizeStyle.Middle;
|
||||
[CanDo]
|
||||
public SizeStyle SizeStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
return _sizeStyle;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _sizeStyle, value))
|
||||
{
|
||||
Width = (double)_sizeStyle;
|
||||
Height = (double)_sizeStyle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static SharpPath NewArrow(double width, double height)
|
||||
=> new SharpPath(FormattableString.Invariant($"M 0 -{height / 2} {width} 0 0 {height / 2}"), width, height, PathStyle.Arrow, (SizeStyle)width);
|
||||
|
||||
public static SharpPath NewCircle(double r)
|
||||
=> new SharpPath(FormattableString.Invariant($"M 0, 0 a {r},{r} 0 1,0 {r * 2},0 a {r},{r} 0 1,0 -{r * 2},0"), r * 2, r * 2, PathStyle.Circle, (SizeStyle)(r * 2));
|
||||
|
||||
public static SharpPath NewRectangle(double width, double height)
|
||||
=> new SharpPath(FormattableString.Invariant($"M 0 -{height / 2} {width} -{height / 2} {width} {height / 2} 0 {height / 2} z"), width, height, PathStyle.Square, (SizeStyle)width);
|
||||
|
||||
public static SharpPath NewSquare(double size) => NewRectangle(size, size);
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
this.Root = root ?? sourceConnectorInfo.Root;
|
||||
if (sinkConnectorInfo is FullyCreatedConnectorInfo sink && sink.DataItem.ShowArrow == false)
|
||||
{
|
||||
this.ShapeViewModel.SinkMarker = new SharpPath("", 10, 10, ArrowPathStyle.None, ArrowSizeStyle.Middle);
|
||||
this.ShapeViewModel.SinkMarker = new SharpPath("", 10, 10, PathStyle.None, SizeStyle.Middle);
|
||||
}
|
||||
var routetype = TypeHelper.GetType(RouterMode);
|
||||
Router = routetype != null ? (System.Activator.CreateInstance(routetype) as IRouter) : new RouterNormal();
|
||||
@@ -661,7 +661,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
}
|
||||
|
||||
private PointBase? GetPortPositionBasedOnAlignment(ConnectorInfoBase port, ArrowSizeStyle marker)
|
||||
private PointBase? GetPortPositionBasedOnAlignment(ConnectorInfoBase port, SizeStyle marker)
|
||||
{
|
||||
if (port == null)
|
||||
return null;
|
||||
|
||||
@@ -9,14 +9,14 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public class LogicalConnectorInfo : FullyCreatedConnectorInfo
|
||||
{
|
||||
public LogicalConnectorInfo(DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, bool isPortless = false, ConnectorValueType valueTypePoint = ConnectorValueType.Real) : base(dataItem, orientation, isInnerPoint, isPortless)
|
||||
public LogicalConnectorInfo(DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, bool isPortless = false, ConnectorValueType connectorValueType = ConnectorValueType.Real) : base(dataItem, orientation, isInnerPoint, isPortless)
|
||||
{
|
||||
this.ConnectorValueType = valueTypePoint;
|
||||
this.ConnectorValueType = connectorValueType;
|
||||
}
|
||||
|
||||
public LogicalConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, bool isPortless = false, ConnectorValueType valueTypePoint = ConnectorValueType.Real) : base(root, dataItem, orientation, isInnerPoint, isPortless)
|
||||
public LogicalConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, bool isPortless = false, ConnectorValueType connectorValueType = ConnectorValueType.Real) : base(root, dataItem, orientation, isInnerPoint, isPortless)
|
||||
{
|
||||
this.ConnectorValueType = valueTypePoint;
|
||||
this.ConnectorValueType = connectorValueType;
|
||||
}
|
||||
|
||||
public LogicalConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, SelectableItemBase designer) : base(root, dataItem, designer)
|
||||
|
||||
@@ -220,48 +220,19 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
return connector;
|
||||
}
|
||||
|
||||
public List<ConnectorValueType> ValueTypeInput
|
||||
public virtual List<ConnectorValueType> ValueTypeInput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LogicalType == LogicalType.NOT)
|
||||
{
|
||||
return new List<ConnectorValueType>() { ConnectorValueType.Bool };
|
||||
}
|
||||
else if (LogicalType == LogicalType.AND || LogicalType == LogicalType.OR || LogicalType == LogicalType.XOR
|
||||
|| LogicalType == LogicalType.SHL || LogicalType == LogicalType.SHR || LogicalType == LogicalType.ROL || LogicalType == LogicalType.ROR)
|
||||
{
|
||||
return new List<ConnectorValueType>() { ConnectorValueType.Int };
|
||||
}
|
||||
else if (LogicalType == LogicalType.SEL)
|
||||
{
|
||||
return new List<ConnectorValueType>() { ConnectorValueType.Bool, ConnectorValueType.Real, ConnectorValueType.Real };
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<ConnectorValueType>() { ConnectorValueType.Real };
|
||||
}
|
||||
return new List<ConnectorValueType>() { ConnectorValueType.Real };
|
||||
}
|
||||
}
|
||||
|
||||
public List<ConnectorValueType> ValueTypeOutput
|
||||
public virtual List<ConnectorValueType> ValueTypeOutput
|
||||
{
|
||||
get
|
||||
{
|
||||
if (LogicalType == LogicalType.GT || LogicalType == LogicalType.LT || LogicalType == LogicalType.GE || LogicalType == LogicalType.LE || LogicalType == LogicalType.EQ || LogicalType == LogicalType.NE
|
||||
|| LogicalType == LogicalType.NOT)
|
||||
{
|
||||
return new List<ConnectorValueType>() { ConnectorValueType.Bool };
|
||||
}
|
||||
else if (LogicalType == LogicalType.AND || LogicalType == LogicalType.OR || LogicalType == LogicalType.XOR
|
||||
|| LogicalType == LogicalType.SHL || LogicalType == LogicalType.SHR || LogicalType == LogicalType.ROL || LogicalType == LogicalType.ROR)
|
||||
{
|
||||
return new List<ConnectorValueType>() { ConnectorValueType.Int };
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<ConnectorValueType>() { ConnectorValueType.Real };
|
||||
}
|
||||
return new List<ConnectorValueType>() { ConnectorValueType.Real };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,6 +241,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
GetInput();
|
||||
CalculateOutput();
|
||||
}
|
||||
|
||||
public virtual void GetInput()
|
||||
{
|
||||
foreach (var input in Input)
|
||||
|
||||
@@ -398,6 +398,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
void SetSharp(IShapeViewModel shapeViewModel, string propertyName, List<SelectableDesignerItemViewModelBase> items);
|
||||
|
||||
void SetAnimation(IAnimationViewModel animationViewModel, string propertyName, List<SelectableDesignerItemViewModelBase> items);
|
||||
|
||||
void SetQuickItem(IQuickThemeViewModel quickThemeViewModel, string propertyName, List<SelectableDesignerItemViewModelBase> items);
|
||||
|
||||
void LockAction(LockObject lockObject, string propertyName, List<SelectableDesignerItemViewModelBase> items);
|
||||
|
||||
@@ -29,12 +29,12 @@ namespace AIStudio.Wpf.DiagramDesigner.Demo.ViewModels
|
||||
|
||||
ConnectionViewModel connector1 = new ConnectionViewModel(DiagramViewModel, node1.RightConnector, node2.LeftConnector, DrawMode.ConnectingLineSmooth, RouterMode.RouterNormal);
|
||||
connector1.ColorViewModel.LineDashStyle = LineDashStyle.Dash1;
|
||||
connector1.AnimationViewModel.LineAnimation = LineAnimation.DashAnimation;
|
||||
connector1.AnimationViewModel.Animation = LineAnimation.DashAnimation;
|
||||
DiagramViewModel.Add(connector1);
|
||||
|
||||
ConnectionViewModel connector2 = new ConnectionViewModel(DiagramViewModel, node2.RightConnector, node3.RightConnector, DrawMode.ConnectingLineStraight, RouterMode.RouterOrthogonal);
|
||||
connector2.ColorViewModel.LineDashStyle = LineDashStyle.Dash1;
|
||||
connector2.AnimationViewModel.LineAnimation = LineAnimation.DashAnimation;
|
||||
connector2.AnimationViewModel.Animation = LineAnimation.DashAnimation;
|
||||
DiagramViewModel.Add(connector2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,12 +30,12 @@ namespace AIStudio.Wpf.DiagramDesigner.Demo.ViewModels
|
||||
|
||||
ConnectionViewModel connector1 = new ConnectionViewModel(DiagramViewModel, node1.RightConnector, node2.LeftConnector, DrawMode.ConnectingLineSmooth, RouterMode.RouterNormal);
|
||||
connector1.ColorViewModel.FillColor.Color = Colors.Red;
|
||||
connector1.AnimationViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
connector1.AnimationViewModel.Animation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector1);
|
||||
|
||||
ConnectionViewModel connector2 = new ConnectionViewModel(DiagramViewModel, node2.RightConnector, node3.RightConnector, DrawMode.ConnectingLineStraight, RouterMode.RouterOrthogonal);
|
||||
connector2.ColorViewModel.FillColor.Color = Colors.Red;
|
||||
connector2.AnimationViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
connector2.AnimationViewModel.Animation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@ namespace AIStudio.Wpf.DiagramDesigner.Demo.ViewModels
|
||||
DiagramViewModel.Add(node2);
|
||||
|
||||
connector1 = new ConnectionViewModel(DiagramViewModel, node1.RightConnector, node2.LeftConnector);
|
||||
connector1.ShapeViewModel.SourceMarker = new SharpPath("M 0 -8 L 3 -8 3 8 0 8 z M 4 -8 7 -8 7 8 4 8 z M 8 -8 16 0 8 8 z", 16, 16, ArrowPathStyle.Arrow, ArrowSizeStyle.ExtraLarge);
|
||||
connector1.ShapeViewModel.SinkMarker = new SharpPath("M 0 -8 L 8 -8 4 0 8 8 0 8 4 0 z", 8, 8, ArrowPathStyle.Arrow, ArrowSizeStyle.Small);
|
||||
connector1.ShapeViewModel.SourceMarker = new SharpPath("M 0 -8 L 3 -8 3 8 0 8 z M 4 -8 7 -8 7 8 4 8 z M 8 -8 16 0 8 8 z", 16, 16, PathStyle.Arrow, SizeStyle.ExtraLarge);
|
||||
connector1.ShapeViewModel.SinkMarker = new SharpPath("M 0 -8 L 8 -8 4 0 8 8 0 8 4 0 z", 8, 8, PathStyle.Arrow, SizeStyle.Small);
|
||||
connector1.AddLabel("Custom");
|
||||
DiagramViewModel.Add(connector1);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,8 +34,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
mindNode.AddConnector(port);
|
||||
}
|
||||
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.None;
|
||||
break;
|
||||
}
|
||||
@@ -51,8 +51,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.25, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
@@ -71,8 +71,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.None;
|
||||
break;
|
||||
}
|
||||
@@ -55,8 +55,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
mindNode.AddConnector(port2);
|
||||
}
|
||||
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
@@ -77,8 +77,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.None, true) { XRatio = 0.5, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.Circle;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.Circle;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.None;
|
||||
break;
|
||||
}
|
||||
@@ -50,8 +50,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port2);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
@@ -70,8 +70,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 1);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.None, true) { XRatio = 0.5, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.Circle;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.Circle;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.None;
|
||||
break;
|
||||
}
|
||||
@@ -50,8 +50,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port2);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
@@ -70,8 +70,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 1);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
|
||||
mindNode.AddConnector(port);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.None;
|
||||
break;
|
||||
}
|
||||
@@ -51,8 +51,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
mindNode.AddConnector(port2);
|
||||
}
|
||||
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Top;
|
||||
break;
|
||||
}
|
||||
@@ -71,8 +71,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = PathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = SizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Top;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user