mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
移除了文件
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
<UserControl x:Class="Serein.Workbench.Themes.ConnectionControl"
|
||||
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:Serein.Workbench.Themes"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Canvas x:Name="PART_Canvas" />
|
||||
</UserControl>
|
||||
@@ -1,89 +0,0 @@
|
||||
using Serein.Library;
|
||||
using Serein.Workbench.Node.View;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Serein.Workbench.Themes
|
||||
{
|
||||
/// <summary>
|
||||
/// ConnectionControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ConnectionControl : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty StartProperty =
|
||||
DependencyProperty.Register("Start", typeof(NodeControlBase), typeof(ConnectionControl),
|
||||
new PropertyMetadata(null, OnConnectionChanged));
|
||||
|
||||
public static readonly DependencyProperty EndProperty =
|
||||
DependencyProperty.Register("End", typeof(NodeControlBase), typeof(ConnectionControl),
|
||||
new PropertyMetadata(null, OnConnectionChanged));
|
||||
|
||||
public static readonly DependencyProperty TypeProperty =
|
||||
DependencyProperty.Register("Type", typeof(ConnectionType), typeof(ConnectionControl),
|
||||
new PropertyMetadata(ConnectionType.IsSucceed, OnConnectionChanged));
|
||||
|
||||
public NodeControlBase Start
|
||||
{
|
||||
get { return (NodeControlBase)GetValue(StartProperty); }
|
||||
set { SetValue(StartProperty, value); }
|
||||
}
|
||||
|
||||
public NodeControlBase End
|
||||
{
|
||||
get { return (NodeControlBase)GetValue(EndProperty); }
|
||||
set { SetValue(EndProperty, value); }
|
||||
}
|
||||
|
||||
public ConnectionType Type
|
||||
{
|
||||
get { return (ConnectionType)GetValue(TypeProperty); }
|
||||
set { SetValue(TypeProperty, value); }
|
||||
}
|
||||
|
||||
private static void OnConnectionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var control = d as ConnectionControl;
|
||||
control?.Refresh();
|
||||
}
|
||||
public ConnectionControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public void Refresh()
|
||||
{
|
||||
if (Start == null || End == null || PART_Canvas == null)
|
||||
return;
|
||||
InitializePath();
|
||||
//BezierLineDrawer.UpdateBezierLine(PART_Canvas, Start, End, _bezierPath, _arrowPath);
|
||||
}
|
||||
|
||||
private System.Windows.Shapes.Path _bezierPath;
|
||||
private System.Windows.Shapes.Path _arrowPath;
|
||||
|
||||
private void InitializePath()
|
||||
{
|
||||
if (_bezierPath == null)
|
||||
{
|
||||
_bezierPath = new System.Windows.Shapes.Path { Stroke = BezierLineDrawer.GetLineColor(Type), StrokeThickness = 1 };
|
||||
PART_Canvas.Children.Add(_bezierPath);
|
||||
}
|
||||
if (_arrowPath == null)
|
||||
{
|
||||
_arrowPath = new System.Windows.Shapes.Path { Stroke = BezierLineDrawer.GetLineColor(Type), Fill = BezierLineDrawer.GetLineColor(Type), StrokeThickness = 1 };
|
||||
PART_Canvas.Children.Add(_arrowPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user