mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-19 16:06:33 +08:00
新增了UI节点
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
@@ -26,6 +27,9 @@
|
||||
<GroupBox x:Name="FlipflopNodeGroupBox" Grid.Row="1" Header="触发器" Margin="5">
|
||||
<ListBox x:Name="FlipflopsListBox" Background="#FACFC1"/>
|
||||
</GroupBox>
|
||||
<GroupBox x:Name="UINodeGroupBox" Grid.Row="2" Header="UI" Margin="5">
|
||||
<ListBox x:Name="UIListBox" Background="#FFFBD7"/>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
@@ -6,10 +6,7 @@ using System.Windows.Input;
|
||||
|
||||
namespace Serein.Workbench.Node.View
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// UserControl1.xaml 的交互逻辑
|
||||
@@ -28,8 +25,11 @@ namespace Serein.Workbench.Node.View
|
||||
this.nodeLibraryInfo = nodeLibraryInfo;
|
||||
Header = "DLL name : " + nodeLibraryInfo.AssemblyName;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
FlipflopNodeGroupBox.Visibility = Visibility.Collapsed;
|
||||
ActionNodeGroupBox.Visibility = Visibility.Collapsed;
|
||||
UINodeGroupBox.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -65,6 +65,16 @@ namespace Serein.Workbench.Node.View
|
||||
FlipflopNodeGroupBox.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向触发器面板添加类型的文本块
|
||||
/// </summary>
|
||||
/// <param name="type">要添加的类型</param>
|
||||
public void AddUI(MethodDetailsInfo mdInfo)
|
||||
{
|
||||
AddTypeToListBox(mdInfo, UIListBox);
|
||||
UINodeGroupBox.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向指定面板添加类型的文本块
|
||||
/// </summary>
|
||||
@@ -137,6 +147,7 @@ namespace Serein.Workbench.Node.View
|
||||
{
|
||||
NodeType.Action => NodeControlType.Action,
|
||||
NodeType.Flipflop => NodeControlType.Flipflop,
|
||||
NodeType.UI => NodeControlType.UI,
|
||||
_ => NodeControlType.None,
|
||||
},
|
||||
MethodDetailsInfo = mdInfo,
|
||||
|
||||
40
Workbench/Node/View/UINodeControl.xaml
Normal file
40
Workbench/Node/View/UINodeControl.xaml
Normal file
@@ -0,0 +1,40 @@
|
||||
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.UINodeControl"
|
||||
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.Node.View"
|
||||
xmlns:vm="clr-namespace:Serein.Workbench.Node.ViewModel"
|
||||
xmlns:themes="clr-namespace:Serein.Workbench.Themes"
|
||||
d:DataContext="{d:DesignInstance vm:UINodeControlViewModel}"
|
||||
mc:Ignorable="d"
|
||||
MinWidth="50"
|
||||
Initialized="NodeControlBase_Initialized"
|
||||
Loaded="NodeControlBase_Loaded"
|
||||
>
|
||||
<Grid x:Name="MainGrid">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0" Background="#E7EFF5" >
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<local:ExecuteJunctionControl Grid.Column="0" MyNode="{Binding NodeModel}" x:Name="ExecuteJunctionControl" HorizontalAlignment="Left" Grid.RowSpan="2"/>
|
||||
<Border Grid.Column="1" BorderThickness="1" HorizontalAlignment="Stretch">
|
||||
<TextBlock Text="UI控件" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Border Grid.Row="1" x:Name="EmbedContainer" BorderBrush="Black" BorderThickness="1"
|
||||
Width="500" Height="400"/>
|
||||
|
||||
|
||||
</Grid>
|
||||
</local:NodeControlBase>
|
||||
65
Workbench/Node/View/UINodeControl.xaml.cs
Normal file
65
Workbench/Node/View/UINodeControl.xaml.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using Serein.Workbench.Node.ViewModel;
|
||||
using Serein.Workbench.Tool;
|
||||
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.Node.View
|
||||
{
|
||||
/// <summary>
|
||||
/// UINodeControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class UINodeControl : NodeControlBase, INodeJunction
|
||||
{
|
||||
public UINodeControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public UINodeControl(UINodeControlViewModel viewModel) : base(viewModel)
|
||||
{
|
||||
DataContext = viewModel;
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public JunctionControlBase ExecuteJunction => this.ExecuteJunctionControl;
|
||||
|
||||
public JunctionControlBase NextStepJunction => throw new NotImplementedException();
|
||||
|
||||
public JunctionControlBase[] ArgDataJunction => throw new NotImplementedException();
|
||||
|
||||
public JunctionControlBase ReturnDataJunction => throw new NotImplementedException();
|
||||
|
||||
|
||||
private void NodeControlBase_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UINodeControlViewModel vm = (UINodeControlViewModel)DataContext;
|
||||
vm.InitAdapter(userControl => {
|
||||
EmbedContainer.Child = userControl;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void NodeControlBase_Initialized(object sender, EventArgs e)
|
||||
{
|
||||
UINodeControlViewModel vm = (UINodeControlViewModel)DataContext;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user