mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-02 15:50:51 +08:00
分离逻辑与常规连接点
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Themes/Generic.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Themes/Style.xaml" />
|
||||
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Styles/Fluent.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Styles/Expander.xaml"/>
|
||||
|
||||
@@ -190,11 +190,11 @@ namespace AIStudio.Wpf.Logical
|
||||
|
||||
if (item.LogicalType == LogicalType.Output)
|
||||
{
|
||||
input.Value.ValueTypePoint = connector.SourceConnectorInfo.ValueTypePoint;
|
||||
input.Value.ValueTypePoint = (connector.SourceConnectorInfo as LogicalConnectorInfo).ValueTypePoint;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.NOT)
|
||||
{
|
||||
input.Value.ValueTypePoint = (connector.SourceConnectorInfo.ValueTypePoint == ValueTypePoint.Bool) ? ValueTypePoint.Bool : ValueTypePoint.Int;
|
||||
input.Value.ValueTypePoint = ((connector.SourceConnectorInfo as LogicalConnectorInfo).ValueTypePoint == ValueTypePoint.Bool) ? ValueTypePoint.Bool : ValueTypePoint.Int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Controls;component/Themes/Colors.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Controls;component/Themes/MahApps.xaml"/>
|
||||
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Themes/Generic.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Themes/Style.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Demo.ViewModels
|
||||
{
|
||||
@@ -28,10 +29,12 @@ namespace AIStudio.Wpf.DiagramDesigner.Demo.ViewModels
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(node3);
|
||||
|
||||
ConnectionViewModel connector1 = new ConnectionViewModel(DiagramViewModel, node1.RightConnector, node2.LeftConnector, DrawMode.ConnectingLineSmooth, RouterMode.RouterNormal);
|
||||
connector1.ColorViewModel.FillColor.Color = Colors.Red;
|
||||
connector1.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector1);
|
||||
|
||||
ConnectionViewModel connector2 = new ConnectionViewModel(DiagramViewModel, node2.RightConnector, node3.RightConnector, DrawMode.ConnectingLineStraight, RouterMode.RouterOrthogonal);
|
||||
connector2.ColorViewModel.FillColor.Color = Colors.Red;
|
||||
connector2.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector2);
|
||||
|
||||
|
||||
@@ -362,7 +362,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
LinkPointDesignerItemViewModel pointItemView = new LinkPointDesignerItemViewModel(rubberbandSelectionStartPoint.Value);
|
||||
_viewModel.DirectAddItemCommand.Execute(pointItemView);
|
||||
SourceConnectorInfo = pointItemView.TopConnector;
|
||||
SourceConnectorInfo = pointItemView.Connectors.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
YRatio = viewmodel.YRatio;
|
||||
IsInnerPoint = viewmodel.IsInnerPoint;
|
||||
IsPortless = viewmodel.IsPortless;
|
||||
ValueTypePoint = viewmodel.ValueTypePoint;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,13 +54,5 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public ValueTypePoint ValueTypePoint
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
/// <summary>
|
||||
/// 完整连接点
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[XmlInclude(typeof(LogicalConnectorInfoItem))]
|
||||
public class LogicalConnectorInfoItem : FullyCreatedConnectorInfoItem
|
||||
{
|
||||
|
||||
public LogicalConnectorInfoItem()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public LogicalConnectorInfoItem(LogicalConnectorInfo viewmodel) : base(viewmodel)
|
||||
{
|
||||
ValueTypePoint = viewmodel.ValueTypePoint;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public ValueTypePoint ValueTypePoint
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -15,10 +15,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
public LogicalGateDesignerItemBase(LogicalGateItemViewModelBase item) : base(item)
|
||||
{
|
||||
this.Connectors = new List<FullyCreatedConnectorInfoItem>();
|
||||
foreach (var fullyCreatedConnectorInfo in item.Connectors)
|
||||
this.Connectors = new List<LogicalConnectorInfoItem>();
|
||||
foreach (var fullyCreatedConnectorInfo in item.Connectors.OfType<LogicalConnectorInfo>())
|
||||
{
|
||||
FullyCreatedConnectorInfoItem connector = new FullyCreatedConnectorInfoItem(fullyCreatedConnectorInfo);
|
||||
LogicalConnectorInfoItem connector = new LogicalConnectorInfoItem(fullyCreatedConnectorInfo);
|
||||
this.Connectors.Add(connector);
|
||||
}
|
||||
this.OrderNumber = item.OrderNumber;
|
||||
@@ -28,7 +28,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
|
||||
[XmlArray]
|
||||
public List<FullyCreatedConnectorInfoItem> Connectors { get; set; }
|
||||
public List<LogicalConnectorInfoItem> Connectors { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public int OrderNumber { get; set; }
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
ColorItem = new ColorItem() { LineColor = new ColorObjectItem(), FillColor = new ColorObjectItem() };
|
||||
FontItem = new FontItem();
|
||||
SharpItem = new SharpItem() { SourceMarker = new LinkMarkerItem(), SinkMarker = new LinkMarkerItem() };
|
||||
}
|
||||
|
||||
public SelectableItemBase(SelectableViewModelBase viewmodel)
|
||||
@@ -776,6 +777,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
get; set;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public ArrowSizeStyle SizeStyle
|
||||
{
|
||||
get; set;
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:AIStudio.Wpf.DiagramDesigner"
|
||||
xmlns:c="clr-namespace:AIStudio.Wpf.DiagramDesigner.Controls">
|
||||
|
||||
<s:ColorBrushConverter x:Key="ColorBrushConverter" />
|
||||
<s:ConectorOrientationConverter x:Key="ConectorOrientationConverter" />
|
||||
<s:ConectorValueConverter x:Key="ConectorValueConverter"/>
|
||||
|
||||
<DataTemplate DataType="{x:Type s:FullyCreatedConnectorInfo}">
|
||||
<Grid Width="{Binding ConnectorWidth}" Height="{Binding ConnectorHeight}">
|
||||
<Grid.ContextMenu>
|
||||
@@ -26,6 +29,81 @@
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type s:LogicalConnectorInfo}">
|
||||
<Grid>
|
||||
<Grid Width="{Binding ConnectorWidth}" Height="{Binding ConnectorHeight}" HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<Grid.ContextMenu>
|
||||
<ContextMenu ItemsSource="{Binding MenuOptions}">
|
||||
<ContextMenu.ItemContainerStyle>
|
||||
<Style TargetType="MenuItem">
|
||||
<Setter Property="MenuItem.Header" Value="{Binding Text}" />
|
||||
<Setter Property="MenuItem.ItemsSource" Value="{Binding Children}" />
|
||||
<Setter Property="MenuItem.Command" Value="{Binding Command}" />
|
||||
<Setter Property="MenuItem.Icon" Value="{Binding Icon}" />
|
||||
<Setter Property="CommandParameter" Value="{Binding CommandParameter}" />
|
||||
<Setter Property="MenuItem.IsCheckable" Value="{Binding IsCheckable}" />
|
||||
<Setter Property="MenuItem.IsChecked" Value="{Binding IsChecked}" />
|
||||
</Style>
|
||||
</ContextMenu.ItemContainerStyle>
|
||||
</ContextMenu>
|
||||
</Grid.ContextMenu>
|
||||
<!-- transparent extra space makes connector easier to hit -->
|
||||
<Rectangle Fill="Transparent" Margin="-2" />
|
||||
<Rectangle Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}" StrokeThickness="1" Stroke="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" />
|
||||
</Grid>
|
||||
|
||||
<Control x:Name="label">
|
||||
<Control.Template>
|
||||
<ControlTemplate>
|
||||
<TextBlock x:Name="txtleft" FontSize="10" RenderTransformOrigin="0.5,0.5">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding Converter="{StaticResource ConectorValueConverter}">
|
||||
<Binding Path="ConnectorValue" />
|
||||
<Binding Path="ValueTypePoint"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
<TextBlock.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform/>
|
||||
<TranslateTransform Y="10" X="{Binding ElementName=txtleft,Path=Text,Converter={StaticResource ConectorOrientationConverter}}"/>
|
||||
</TransformGroup>
|
||||
</TextBlock.RenderTransform>
|
||||
</TextBlock>
|
||||
</ControlTemplate>
|
||||
</Control.Template>
|
||||
</Control>
|
||||
|
||||
</Grid>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Value="Right" Binding="{Binding Orientation}">
|
||||
<Setter TargetName="label" Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<TextBlock x:Name="txtRight" FontSize="10" RenderTransformOrigin="0.5,0.5" >
|
||||
<TextBlock.Text>
|
||||
<MultiBinding Converter="{StaticResource ConectorValueConverter}">
|
||||
<Binding Path="ConnectorValue" />
|
||||
<Binding Path="ValueTypePoint"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
<TextBlock.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform/>
|
||||
<TranslateTransform Y="10" X="5"/>
|
||||
</TransformGroup>
|
||||
</TextBlock.RenderTransform>
|
||||
</TextBlock>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- DragThumb Default Template -->
|
||||
<Style TargetType="{x:Type c:DragThumb}">
|
||||
<Setter Property="Template">
|
||||
|
||||
@@ -9,14 +9,5 @@
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/AIStudio.Wpf.DiagramDesigner;component/Themes/DesignerItem.xaml" />
|
||||
<ResourceDictionary Source="/AIStudio.Wpf.DiagramDesigner;component/Themes/ConnectorItem.xaml" />
|
||||
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/ScrollBar.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/Expander.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/GroupBox.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/ToolTip.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/ScrollViewer.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/TextBox.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/ZoomBox.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/ComboBox.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
13
AIStudio.Wpf.DiagramDesigner/Themes/Style.xaml
Normal file
13
AIStudio.Wpf.DiagramDesigner/Themes/Style.xaml
Normal file
@@ -0,0 +1,13 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/ScrollBar.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/Expander.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/GroupBox.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/ToolTip.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/ScrollViewer.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/TextBox.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/ZoomBox.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/ComboBox.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
@@ -157,111 +157,7 @@
|
||||
</Style>
|
||||
|
||||
<!-- Connector Style -->
|
||||
<Style x:Key="DefaultConnectorStyle" TargetType="{x:Type s:Connector}">
|
||||
<Setter Property="Cursor" Value="Cross" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="true" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type s:Connector}">
|
||||
<Grid Width="{Binding ConnectorWidth}" Height="{Binding ConnectorHeight}">
|
||||
<Grid.ContextMenu>
|
||||
<ContextMenu ItemsSource="{Binding MenuOptions}" >
|
||||
<ContextMenu.ItemContainerStyle>
|
||||
<Style TargetType="MenuItem">
|
||||
<Setter Property="MenuItem.Header" Value="{Binding Text}" />
|
||||
<Setter Property="MenuItem.ItemsSource" Value="{Binding Children}" />
|
||||
<Setter Property="MenuItem.Command" Value="{Binding Command}" />
|
||||
<Setter Property="MenuItem.Icon" Value="{Binding Icon}" />
|
||||
<Setter Property="CommandParameter" Value="{Binding CommandParameter}" />
|
||||
<Setter Property="MenuItem.IsCheckable" Value="{Binding IsCheckable}" />
|
||||
<Setter Property="MenuItem.IsChecked" Value="{Binding IsChecked}" />
|
||||
</Style>
|
||||
</ContextMenu.ItemContainerStyle>
|
||||
</ContextMenu>
|
||||
</Grid.ContextMenu>
|
||||
transparent extra space makes connector easier to hit
|
||||
<Rectangle Fill="Transparent" Margin="-2" />
|
||||
<Rectangle Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}" StrokeThickness="1" Stroke="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Connector Style -->
|
||||
<Style x:Key="LogicalConnectorStyle" TargetType="{x:Type s:Connector}">
|
||||
<Setter Property="Cursor" Value="Cross" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="true" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type s:Connector}">
|
||||
<Grid>
|
||||
<Grid Width="{Binding ConnectorWidth}" Height="{Binding ConnectorHeight}" HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<Grid.ContextMenu>
|
||||
<ContextMenu ItemsSource="{Binding MenuOptions}">
|
||||
<ContextMenu.ItemContainerStyle>
|
||||
<Style TargetType="MenuItem">
|
||||
<Setter Property="MenuItem.Header" Value="{Binding Text}" />
|
||||
<Setter Property="MenuItem.ItemsSource" Value="{Binding Children}" />
|
||||
<Setter Property="MenuItem.Command" Value="{Binding Command}" />
|
||||
<Setter Property="MenuItem.Icon" Value="{Binding Icon}" />
|
||||
<Setter Property="CommandParameter" Value="{Binding CommandParameter}" />
|
||||
<Setter Property="MenuItem.IsCheckable" Value="{Binding IsCheckable}" />
|
||||
<Setter Property="MenuItem.IsChecked" Value="{Binding IsChecked}" />
|
||||
</Style>
|
||||
</ContextMenu.ItemContainerStyle>
|
||||
</ContextMenu>
|
||||
</Grid.ContextMenu>
|
||||
<!-- transparent extra space makes connector easier to hit -->
|
||||
<Rectangle Fill="Transparent" Margin="-2" />
|
||||
<Rectangle Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}" StrokeThickness="1" Stroke="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" />
|
||||
</Grid>
|
||||
<TextBlock x:Name="txtleft" FontSize="10" RenderTransformOrigin="0.5,0.5">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding Converter="{StaticResource ConectorValueConverter}">
|
||||
<Binding Path="ConnectorValue" />
|
||||
<Binding Path="ValueTypePoint"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
<TextBlock.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform/>
|
||||
<TranslateTransform Y="10" X="{Binding ElementName=txtleft,Path=Text,Converter={StaticResource ConectorOrientationConverter}}"/>
|
||||
</TransformGroup>
|
||||
</TextBlock.RenderTransform>
|
||||
</TextBlock>
|
||||
<TextBlock x:Name="txtRight" FontSize="10" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding Converter="{StaticResource ConectorValueConverter}">
|
||||
<Binding Path="ConnectorValue" />
|
||||
<Binding Path="ValueTypePoint"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
<TextBlock.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform/>
|
||||
<TranslateTransform Y="10" X="5"/>
|
||||
</TransformGroup>
|
||||
</TextBlock.RenderTransform>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<DataTrigger Value="Right" Binding="{Binding Orientation}">
|
||||
<Setter TargetName="txtleft" Property="Visibility" Value="Collapsed" />
|
||||
<Setter TargetName="txtRight" Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Connector Style -->
|
||||
<Style x:Key="pointConnector" TargetType="{x:Type s:PointConnector}">
|
||||
<Style x:Key="PointConnectorStyle" TargetType="{x:Type s:PointConnector}">
|
||||
<Setter Property="SnapsToDevicePixels" Value="true" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -276,7 +172,7 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="normalConnectorContainer" TargetType="{x:Type s:ConnectorContainer}">
|
||||
<Style x:Key="GifImageConnectorContainer" TargetType="{x:Type s:ConnectorContainer}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ItemsControl}">
|
||||
@@ -295,7 +191,7 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="innerConnectorContainer" TargetType="{x:Type ItemsControl}">
|
||||
<Style x:Key="ItemsControlStyle" TargetType="{x:Type ItemsControl}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ItemsControl}">
|
||||
@@ -381,11 +277,14 @@
|
||||
|
||||
<ControlTemplate x:Key="InnerConnectorDecoratorTemplate"
|
||||
TargetType="{x:Type Control}">
|
||||
<s:ConnectorContainer x:Name="PART_ConnectorContainer" Style="{StaticResource innerConnectorContainer}" ItemsSource="{Binding Connectors}" Visibility="{Binding Path=ShowConnectors, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
|
||||
<s:ConnectorContainer x:Name="PART_ConnectorContainer" Style="{StaticResource ItemsControlStyle}" ItemsSource="{Binding Connectors}" Visibility="{Binding Path=ShowConnectors, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
|
||||
<s:ConnectorContainer.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<s:Connector Style="{StaticResource DefaultConnectorStyle}"/>
|
||||
<s:Connector
|
||||
Content="{Binding .}"
|
||||
Cursor="Cross"
|
||||
SnapsToDevicePixels="True"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</s:ConnectorContainer.ItemTemplate>
|
||||
@@ -590,7 +489,7 @@
|
||||
</c:DragThumb.InputBindings>
|
||||
</c:DragThumb>
|
||||
|
||||
<s:PointContainer x:Name="PART_VerticesContainer" Style="{StaticResource innerConnectorContainer}" ItemsSource="{Binding Vertices}" Visibility="Collapsed">
|
||||
<s:PointContainer x:Name="PART_VerticesContainer" Style="{StaticResource ItemsControlStyle}" ItemsSource="{Binding Vertices}" Visibility="Collapsed">
|
||||
<s:PointContainer.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
@@ -599,7 +498,7 @@
|
||||
<MenuItem Header="删除" Command="{Binding DeleteVertexCommand}" CommandParameter="{Binding}"/>
|
||||
</ContextMenu>
|
||||
</Grid.ContextMenu>
|
||||
<s:PointConnector Style="{StaticResource pointConnector}"/>
|
||||
<s:PointConnector Style="{StaticResource PointConnectorStyle}"/>
|
||||
<c:PointDragThumb Cursor="SizeAll" Opacity="0"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
@@ -612,11 +511,10 @@
|
||||
</s:PointContainer.Resources>
|
||||
</s:PointContainer>
|
||||
|
||||
<s:PointContainer x:Name="PART_LabelsContainer" Style="{StaticResource innerConnectorContainer}" ItemsSource="{Binding Labels}" >
|
||||
<s:PointContainer x:Name="PART_LabelsContainer" Style="{StaticResource ItemsControlStyle}" ItemsSource="{Binding Labels}" >
|
||||
<s:PointContainer.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid s:SelectionProps.EnabledForSelection="True" Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}">
|
||||
|
||||
<Grid.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="删除" Command="{Binding DeleteLabelCommand}" CommandParameter="{Binding}"/>
|
||||
@@ -628,8 +526,6 @@
|
||||
</c:PointDragThumb.InputBindings>
|
||||
</c:PointDragThumb>
|
||||
<s:TextControl Margin="5" />
|
||||
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</s:PointContainer.ItemTemplate>
|
||||
@@ -710,10 +606,10 @@
|
||||
VerticalAlignment="Stretch"
|
||||
Content="{TemplateBinding Content}" />
|
||||
<!-- PART_ConnectorDecorator -->
|
||||
<s:ConnectorContainer x:Name="PART_ConnectorContainer" Visibility="Hidden" Style="{StaticResource normalConnectorContainer}" ItemsSource="{Binding Connectors}">
|
||||
<s:ConnectorContainer x:Name="PART_ConnectorContainer" Visibility="Hidden" Style="{StaticResource GifImageConnectorContainer}" ItemsSource="{Binding Connectors}">
|
||||
<s:ConnectorContainer.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<s:Connector Style="{StaticResource DefaultConnectorStyle}"/>
|
||||
<s:Connector Content="{Binding .}" Cursor="Cross" SnapsToDevicePixels="True"/>
|
||||
</DataTemplate>
|
||||
</s:ConnectorContainer.ItemTemplate>
|
||||
</s:ConnectorContainer>
|
||||
@@ -785,11 +681,11 @@
|
||||
</Grid.ContextMenu>
|
||||
|
||||
<!--PART_ConnectorDecorator-->
|
||||
<s:ConnectorContainer x:Name="PART_ConnectorContainer" Style="{StaticResource innerConnectorContainer}" ItemsSource="{Binding Connectors}" Margin="0,0,0,0">
|
||||
<s:ConnectorContainer x:Name="PART_ConnectorContainer" Style="{StaticResource ItemsControlStyle}" ItemsSource="{Binding Connectors}" Margin="0,0,0,0">
|
||||
<s:ConnectorContainer.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<s:Connector Style="{StaticResource LogicalConnectorStyle}"/>
|
||||
<s:Connector Content="{Binding .}" Cursor="Cross" SnapsToDevicePixels="True"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</s:ConnectorContainer.ItemTemplate>
|
||||
@@ -848,7 +744,7 @@
|
||||
<!-- PART_ConnectorDecorator -->
|
||||
<Grid Margin="-5"
|
||||
x:Name="PART_ConnectorDecorator">
|
||||
<s:PointConnector DataContext="{Binding TopConnector}" Style="{StaticResource pointConnector}"/>
|
||||
<s:PointConnector DataContext="{Binding TopConnector}" Style="{StaticResource PointConnectorStyle}"/>
|
||||
</Grid>
|
||||
<!-- PART_DragThumb -->
|
||||
<c:DragThumb x:Name="PART_DragThumb"
|
||||
@@ -895,8 +791,9 @@
|
||||
<!-- PART_ConnectorDecorator -->
|
||||
<Grid Margin="-5"
|
||||
x:Name="PART_ConnectorDecorator">
|
||||
<s:Connector DataContext="{Binding TopConnector}" Style="{StaticResource DefaultConnectorStyle}"
|
||||
Orientation="Right"
|
||||
<s:Connector Content="{Binding Connectors[0]}"
|
||||
Cursor="Cross"
|
||||
SnapsToDevicePixels="True"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
Visibility="{Binding Path=ShowConnectors, Converter={x:Static s:BoolToVisibilityConverter.Instance}}" />
|
||||
|
||||
@@ -51,8 +51,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
protected virtual void Init(FullyCreatedConnectorInfo sourceConnectorInfo, ConnectorInfoBase sinkConnectorInfo)
|
||||
{
|
||||
this.Root = sourceConnectorInfo.DataItem.Root;
|
||||
|
||||
this.ColorViewModel.FillColor.Color = Colors.Red;
|
||||
|
||||
if (sinkConnectorInfo is FullyCreatedConnectorInfo sink && sink.DataItem.ShowArrow == false)
|
||||
{
|
||||
this.ShapeViewModel.SinkMarker = LinkMarker.None;
|
||||
@@ -417,14 +416,14 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
break;
|
||||
case nameof(SourceConnectorInfo):
|
||||
SourceA = PointHelper.GetPointForConnector(SourceConnectorInfo);
|
||||
(SourceConnectorInfo.DataItem as INotifyPropertyChanged).PropertyChanged += new WeakINPCEventHandler(ConnectorViewModel_PropertyChanged).Handler;
|
||||
(SourceConnectorInfo.DataItem as INotifyPropertyChanged).PropertyChanged += new WeakINPCEventHandler(ConnectorViewModel_PropertyChanged).Handler;
|
||||
break;
|
||||
case nameof(SinkConnectorInfo):
|
||||
SourceB = SinkConnectorInfo.Position;
|
||||
if (SinkConnectorInfo is FullyCreatedConnectorInfo)
|
||||
{
|
||||
(((FullyCreatedConnectorInfo)SinkConnectorInfo).DataItem as INotifyPropertyChanged).PropertyChanged += new WeakINPCEventHandler(ConnectorViewModel_PropertyChanged).Handler;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case nameof(IsSelected):
|
||||
if (IsSelected == false)
|
||||
@@ -521,67 +520,74 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
PathGeneratorResult = PathGenerator.Get(Root, this, route, source.Value, target.Value);
|
||||
|
||||
//修正旋转
|
||||
switch (SourceConnectorInfo.Orientation)
|
||||
if (IsFullConnection)
|
||||
{
|
||||
case ConnectorOrientation.Left:
|
||||
{
|
||||
StartPoint = new PointBase(PathGeneratorResult.SourceMarkerPosition.X, PathGeneratorResult.SourceMarkerPosition.Y - GetSourceMarkerWidth() / 2);
|
||||
break;
|
||||
}
|
||||
case ConnectorOrientation.Top:
|
||||
{
|
||||
StartPoint = new PointBase(PathGeneratorResult.SourceMarkerPosition.X - GetSourceMarkerWidth() / 2, PathGeneratorResult.SourceMarkerPosition.Y);
|
||||
break;
|
||||
}
|
||||
case ConnectorOrientation.Right:
|
||||
{
|
||||
StartPoint = new PointBase(PathGeneratorResult.SourceMarkerPosition.X - GetSourceMarkerWidth(), PathGeneratorResult.SourceMarkerPosition.Y - GetSourceMarkerWidth() / 2);
|
||||
break;
|
||||
}
|
||||
case ConnectorOrientation.Bottom:
|
||||
{
|
||||
StartPoint = new PointBase(PathGeneratorResult.SourceMarkerPosition.X - GetSourceMarkerWidth() / 2, PathGeneratorResult.SourceMarkerPosition.Y - GetSourceMarkerWidth());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
StartPoint = PathGeneratorResult.SourceMarkerPosition;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//修正旋转
|
||||
switch (SourceConnectorInfo.Orientation)
|
||||
{
|
||||
case ConnectorOrientation.Left:
|
||||
{
|
||||
StartPoint = new PointBase(PathGeneratorResult.SourceMarkerPosition.X, PathGeneratorResult.SourceMarkerPosition.Y - GetSourceMarkerWidth() / 2);
|
||||
break;
|
||||
}
|
||||
case ConnectorOrientation.Top:
|
||||
{
|
||||
StartPoint = new PointBase(PathGeneratorResult.SourceMarkerPosition.X - GetSourceMarkerWidth() / 2, PathGeneratorResult.SourceMarkerPosition.Y);
|
||||
break;
|
||||
}
|
||||
case ConnectorOrientation.Right:
|
||||
{
|
||||
StartPoint = new PointBase(PathGeneratorResult.SourceMarkerPosition.X - GetSourceMarkerWidth(), PathGeneratorResult.SourceMarkerPosition.Y - GetSourceMarkerWidth() / 2);
|
||||
break;
|
||||
}
|
||||
case ConnectorOrientation.Bottom:
|
||||
{
|
||||
StartPoint = new PointBase(PathGeneratorResult.SourceMarkerPosition.X - GetSourceMarkerWidth() / 2, PathGeneratorResult.SourceMarkerPosition.Y - GetSourceMarkerWidth());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
StartPoint = PathGeneratorResult.SourceMarkerPosition;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//修正旋转
|
||||
switch (SinkConnectorInfo.Orientation)
|
||||
//修正旋转
|
||||
switch (SinkConnectorInfo.Orientation)
|
||||
{
|
||||
case ConnectorOrientation.Left:
|
||||
{
|
||||
EndPoint = new PointBase(PathGeneratorResult.TargetMarkerPosition.X, PathGeneratorResult.TargetMarkerPosition.Y - GetSinkMarkerWidth() / 2);
|
||||
break;
|
||||
}
|
||||
|
||||
case ConnectorOrientation.Top:
|
||||
{
|
||||
EndPoint = new PointBase(PathGeneratorResult.TargetMarkerPosition.X - GetSinkMarkerWidth() / 2, PathGeneratorResult.TargetMarkerPosition.Y);
|
||||
break;
|
||||
}
|
||||
case ConnectorOrientation.Right:
|
||||
{
|
||||
EndPoint = new PointBase(PathGeneratorResult.TargetMarkerPosition.X - GetSinkMarkerWidth(), PathGeneratorResult.TargetMarkerPosition.Y - GetSinkMarkerWidth() / 2);
|
||||
break;
|
||||
}
|
||||
case ConnectorOrientation.Bottom:
|
||||
{
|
||||
EndPoint = new PointBase(PathGeneratorResult.TargetMarkerPosition.X - GetSinkMarkerWidth() / 2, PathGeneratorResult.TargetMarkerPosition.Y - GetSinkMarkerWidth());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
EndPoint = PathGeneratorResult.TargetMarkerPosition;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
case ConnectorOrientation.Left:
|
||||
{
|
||||
EndPoint = new PointBase(PathGeneratorResult.TargetMarkerPosition.X, PathGeneratorResult.TargetMarkerPosition.Y - GetSinkMarkerWidth() / 2);
|
||||
break;
|
||||
}
|
||||
|
||||
case ConnectorOrientation.Top:
|
||||
{
|
||||
EndPoint = new PointBase(PathGeneratorResult.TargetMarkerPosition.X - GetSinkMarkerWidth() / 2, PathGeneratorResult.TargetMarkerPosition.Y);
|
||||
break;
|
||||
}
|
||||
case ConnectorOrientation.Right:
|
||||
{
|
||||
EndPoint = new PointBase(PathGeneratorResult.TargetMarkerPosition.X - GetSinkMarkerWidth(), PathGeneratorResult.TargetMarkerPosition.Y - GetSinkMarkerWidth() / 2);
|
||||
break;
|
||||
}
|
||||
case ConnectorOrientation.Bottom:
|
||||
{
|
||||
EndPoint = new PointBase(PathGeneratorResult.TargetMarkerPosition.X - GetSinkMarkerWidth() / 2, PathGeneratorResult.TargetMarkerPosition.Y - GetSinkMarkerWidth());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
EndPoint = PathGeneratorResult.TargetMarkerPosition;
|
||||
break;
|
||||
}
|
||||
StartPoint = PathGeneratorResult.SourceMarkerPosition;
|
||||
EndPoint = PathGeneratorResult.TargetMarkerPosition;
|
||||
}
|
||||
|
||||
StartAngle = PathGeneratorResult.SourceMarkerAngle;
|
||||
EndAngle = PathGeneratorResult.TargetMarkerAngle;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
this.Parent = dataItem;
|
||||
this.IsInnerPoint = isInnerPoint;
|
||||
this.IsPortless = IsPortless;
|
||||
this.ValueTypePoint = valueTypePoint;
|
||||
|
||||
if (IsInnerPoint == true)
|
||||
{
|
||||
BuildMenuOptions();
|
||||
@@ -71,7 +71,6 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
YRatio = designer.YRatio;
|
||||
IsInnerPoint = designer.IsInnerPoint;
|
||||
IsPortless = designer.IsPortless;
|
||||
ValueTypePoint = designer.ValueTypePoint;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,19 +149,6 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
get; set;
|
||||
}
|
||||
|
||||
public ValueTypePoint _valueTypePoint;
|
||||
public ValueTypePoint ValueTypePoint
|
||||
{
|
||||
get
|
||||
{
|
||||
return _valueTypePoint;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _valueTypePoint, value);
|
||||
}
|
||||
}
|
||||
|
||||
private Style _style;
|
||||
public Style Style
|
||||
{
|
||||
@@ -191,6 +177,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
public void ExecuteMenuItemCommand(object arg)
|
||||
{
|
||||
Orientation = (ConnectorOrientation)arg;
|
||||
DataItem.Left += 0.1;
|
||||
DataItem.Left -= 0.1;
|
||||
}
|
||||
|
||||
public void ExecuteDeleteCommand(object arg)
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public class LogicalConnectorInfo : FullyCreatedConnectorInfo
|
||||
{
|
||||
public LogicalConnectorInfo(DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, bool isPortless = false, ValueTypePoint valueTypePoint = ValueTypePoint.Real) : base(dataItem, orientation, isInnerPoint, isPortless, valueTypePoint)
|
||||
{
|
||||
}
|
||||
|
||||
public LogicalConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, bool isPortless = false, ValueTypePoint valueTypePoint = ValueTypePoint.Real) : base(root, dataItem, orientation, isInnerPoint, isPortless, valueTypePoint)
|
||||
{
|
||||
this.ValueTypePoint = valueTypePoint;
|
||||
}
|
||||
|
||||
public LogicalConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, SelectableItemBase designer) : base(root, dataItem, designer)
|
||||
{
|
||||
}
|
||||
|
||||
public LogicalConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, SerializableItem serializableItem, string serializableType) : base(root, dataItem, serializableItem, serializableType)
|
||||
{
|
||||
}
|
||||
|
||||
public override SelectableItemBase GetSerializableObject()
|
||||
{
|
||||
return new LogicalConnectorInfoItem(this);
|
||||
}
|
||||
|
||||
protected override void LoadDesignerItemViewModel(SelectableItemBase designerbase)
|
||||
{
|
||||
base.LoadDesignerItemViewModel(designerbase);
|
||||
|
||||
if (designerbase is LogicalConnectorInfoItem designer)
|
||||
{
|
||||
ValueTypePoint = designer.ValueTypePoint;
|
||||
}
|
||||
}
|
||||
|
||||
public ValueTypePoint _valueTypePoint;
|
||||
public ValueTypePoint ValueTypePoint
|
||||
{
|
||||
get
|
||||
{
|
||||
return _valueTypePoint;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _valueTypePoint, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,17 +43,16 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
|
||||
protected override void Init(IDiagramViewModel root)
|
||||
{
|
||||
{
|
||||
base.Init(root);
|
||||
|
||||
ClearConnectors();
|
||||
//propertyChangedSubscription = WhenPropertyChanged.Where(o => o.ToString() == "Left" || o.ToString() == "Top" || o.ToString() == "ItemWidth" || o.ToString() == "ItemHeight").Subscribe(ChangeImageElement);
|
||||
//connectorsChangedSubscription = WhenConnectorsChanged.Subscribe(OnConnectorsChanged);
|
||||
|
||||
BuildMenuOptions();
|
||||
|
||||
|
||||
AddItemCommand = new SimpleCommand(Command_Enable, ExecuteAddItemCommand);
|
||||
ImageSwitchCommand = new SimpleCommand(Command_Enable, ExecuteImageSwitchCommand);
|
||||
BuildMenuOptions();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
foreach (var connector in designer.Connectors)
|
||||
{
|
||||
FullyCreatedConnectorInfo fullyCreatedConnectorInfo = new FullyCreatedConnectorInfo(this.Root, this, connector);
|
||||
LogicalConnectorInfo fullyCreatedConnectorInfo = new LogicalConnectorInfo(this.Root, this, connector);
|
||||
|
||||
if (fullyCreatedConnectorInfo.Orientation == ConnectorOrientation.Left)
|
||||
{
|
||||
@@ -213,8 +213,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
public LogicalType LogicalType { get; set; }
|
||||
|
||||
|
||||
public Dictionary<int, FullyCreatedConnectorInfo> Input { get; set; } = new Dictionary<int, FullyCreatedConnectorInfo>();
|
||||
public Dictionary<int, FullyCreatedConnectorInfo> Output { get; set; } = new Dictionary<int, FullyCreatedConnectorInfo>();
|
||||
public Dictionary<int, LogicalConnectorInfo> Input { get; set; } = new Dictionary<int, LogicalConnectorInfo>();
|
||||
public Dictionary<int, LogicalConnectorInfo> Output { get; set; } = new Dictionary<int, LogicalConnectorInfo>();
|
||||
|
||||
public virtual void ExecuteAddInput(object parameter, int index = 0)
|
||||
{
|
||||
@@ -222,7 +222,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
this.ItemHeight = this.ItemHeight * (Input.Values.Count + 1) / Input.Values.Count;
|
||||
}
|
||||
FullyCreatedConnectorInfo connector = new FullyCreatedConnectorInfo(this, ConnectorOrientation.Left, true, false, ValueTypeInput.Count > index ? ValueTypeInput[index] : ValueTypeInput[0]);
|
||||
LogicalConnectorInfo connector = new LogicalConnectorInfo(this, ConnectorOrientation.Left, true, false, ValueTypeInput.Count > index ? ValueTypeInput[index] : ValueTypeInput[0]);
|
||||
connector.XRatio = 0;
|
||||
Input.Add(Input.Count, connector);
|
||||
for (int i = 0; i < Input.Values.Count; i++)
|
||||
@@ -234,7 +234,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
public virtual void ExecuteAddOutput(object parameter, int index = 0)
|
||||
{
|
||||
FullyCreatedConnectorInfo connector = new FullyCreatedConnectorInfo(this, ConnectorOrientation.Right, true, false, ValueTypeOutput.Count > index ? ValueTypeOutput[index] : ValueTypeInput[0]);
|
||||
LogicalConnectorInfo connector = new LogicalConnectorInfo(this, ConnectorOrientation.Right, true, false, ValueTypeOutput.Count > index ? ValueTypeOutput[index] : ValueTypeInput[0]);
|
||||
connector.XRatio = 1;
|
||||
Output.Add(Output.Count, connector);
|
||||
for (int i = 0; i < Output.Values.Count; i++)
|
||||
|
||||
Reference in New Issue
Block a user