2024-08-05 10:11:58 +08:00
|
|
|
<Window x:Class="Serein.WorkBench.MainWindow"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:local="clr-namespace:Serein.WorkBench"
|
|
|
|
|
xmlns:custom="clr-namespace:Serein.WorkBench.Node.View"
|
|
|
|
|
Title="Dynamic Node Flow" Height="700" Width="1200"
|
|
|
|
|
AllowDrop="True" Drop="Window_Drop" DragOver="Window_DragOver"
|
|
|
|
|
Loaded="Window_Loaded"
|
2024-09-17 14:20:27 +08:00
|
|
|
ContentRendered="Window_ContentRendered"
|
2024-08-05 10:11:58 +08:00
|
|
|
Closing="Window_Closing">
|
|
|
|
|
|
2024-09-10 11:05:48 +08:00
|
|
|
<Window.Resources>
|
|
|
|
|
<local:RightThumbPositionConverter x:Key="RightThumbPositionConverter" />
|
|
|
|
|
<local:BottomThumbPositionConverter x:Key="BottomThumbPositionConverter" />
|
|
|
|
|
<local:VerticalCenterThumbPositionConverter x:Key="VerticalCenterThumbPositionConverter" />
|
|
|
|
|
<local:HorizontalCenterThumbPositionConverter x:Key="HorizontalCenterThumbPositionConverter" />
|
|
|
|
|
</Window.Resources>
|
|
|
|
|
|
2024-08-05 10:11:58 +08:00
|
|
|
<Window.InputBindings>
|
|
|
|
|
<KeyBinding Key="Escape" Command="{Binding CancelConnectionCommand}"/>
|
2024-09-10 11:05:48 +08:00
|
|
|
|
|
|
|
|
|
2024-08-05 10:11:58 +08:00
|
|
|
</Window.InputBindings>
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="1*"/>
|
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
|
<ColumnDefinition Width="3*"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
<DockPanel Grid.Column="0" Background="#F5F5F5">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="40"></RowDefinition>
|
|
|
|
|
<RowDefinition Height="Auto"></RowDefinition>
|
|
|
|
|
<RowDefinition Height="2*"></RowDefinition>
|
|
|
|
|
<RowDefinition Height="*"></RowDefinition>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<!--<Button Grid.Row="0" Content="Button 1"></Button>
|
|
|
|
|
<Button Grid.Row="1" Content="Button 2"></Button>
|
|
|
|
|
<Button Grid.Row="2" Content="Button 3"></Button>
|
|
|
|
|
<Button Grid.Row="3" Content="Button 4"></Button>-->
|
|
|
|
|
<!--DockPanel.Dock="Top"-->
|
|
|
|
|
|
|
|
|
|
<Grid Margin="2,2,2,5">
|
|
|
|
|
<Button Grid.Row="0" Content="保存项目" Click="ButtonSaveFile_Click" HorizontalAlignment="Left" Margin="5,5,5,5"/>
|
|
|
|
|
<Button Grid.Row="0" Content="卸载清空" Click="UnloadAllButton_Click" HorizontalAlignment="Right" Margin="5,5,5,5"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto">
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<!--<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
</Grid.ColumnDefinitions>-->
|
|
|
|
|
|
2024-09-15 12:15:32 +08:00
|
|
|
<custom:ExpOpNodeControl x:Name="ExpOpNodeControl" Margin="10" AllowDrop="True" PreviewMouseMove="BaseNodeControl_PreviewMouseMove"/>
|
|
|
|
|
<custom:ConditionNodeControl x:Name="ConditionNodeControl" Margin="10" AllowDrop="True" PreviewMouseMove="BaseNodeControl_PreviewMouseMove"/>
|
|
|
|
|
<custom:ConditionRegionControl x:Name="ConditionRegionControl" Margin="10" AllowDrop="True" PreviewMouseMove="BaseNodeControl_PreviewMouseMove"/>
|
2024-08-05 10:11:58 +08:00
|
|
|
<!--<custom:ActionRegionControl x:Name="ActionRegionControl" Grid.Column="1" Margin="10" AllowDrop="True" Drop="ActionRegionControl_Drop" PreviewMouseMove="RegionControl_PreviewMouseMove"/>-->
|
|
|
|
|
<!--<TextBlock Text="触发器" Grid.Column="2"/>-->
|
|
|
|
|
<!--<custom:StateRegionControl x:Name="StateRegionControl" Grid.Column="2" Margin="10" AllowDrop="True" Drop="StateRegionControl_Drop" PreviewMouseMove="RegionControl_PreviewMouseMove"/>-->
|
|
|
|
|
<!--</Grid>-->
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</ScrollViewer>
|
|
|
|
|
<ScrollViewer Grid.Row="2" VerticalScrollBarVisibility="Auto">
|
|
|
|
|
<StackPanel x:Name="DllStackPanel" Margin="5"/>
|
|
|
|
|
</ScrollViewer>
|
|
|
|
|
</Grid>
|
|
|
|
|
</DockPanel>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ResizeBehavior="PreviousAndNext" Background="Gray"/>
|
|
|
|
|
|
|
|
|
|
<Grid Grid.Column="2" >
|
2024-09-10 11:05:48 +08:00
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
2024-08-05 10:11:58 +08:00
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="60"></RowDefinition>
|
|
|
|
|
<RowDefinition Height="*"></RowDefinition>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<StackPanel Grid.Row="0" Background="#F5F5F5" Orientation="Horizontal" >
|
|
|
|
|
<Button x:Name="ButtonDebugRun" Content="运行" Width="100" Margin="10" Click="ButtonDebugRun_Click"></Button>
|
2024-09-17 14:20:27 +08:00
|
|
|
<Button x:Name="ButtonDebugFlipflopNode" Content="结束" Width="100" Margin="10" Click="ButtonDebugFlipflopNode_Click"></Button>
|
2024-08-05 10:11:58 +08:00
|
|
|
</StackPanel>
|
2024-09-10 11:05:48 +08:00
|
|
|
|
|
|
|
|
<StackPanel Grid.Row="1"
|
2024-09-10 11:49:56 +08:00
|
|
|
x:Name="FlowChartStackPanel"
|
|
|
|
|
ClipToBounds="True">
|
2024-09-10 11:05:48 +08:00
|
|
|
<Canvas
|
|
|
|
|
x:Name="FlowChartCanvas"
|
2024-09-10 11:49:56 +08:00
|
|
|
Background="#D9FFEA"
|
2024-09-10 11:05:48 +08:00
|
|
|
AllowDrop="True"
|
2024-09-12 20:32:54 +08:00
|
|
|
Width="1000"
|
|
|
|
|
Height="700"
|
|
|
|
|
MouseLeftButtonDown ="FlowChartCanvas_MouseLeftButtonDown"
|
|
|
|
|
MouseLeftButtonUp="FlowChartCanvas_MouseLeftButtonUp"
|
2024-09-10 11:05:48 +08:00
|
|
|
MouseDown="FlowChartCanvas_MouseDown"
|
|
|
|
|
MouseMove="FlowChartCanvas_MouseMove"
|
|
|
|
|
MouseUp="FlowChartCanvas_MouseUp"
|
|
|
|
|
MouseWheel="FlowChartCanvas_MouseWheel"
|
|
|
|
|
Drop="FlowChartCanvas_Drop"
|
|
|
|
|
DragOver="FlowChartCanvas_DragOver">
|
|
|
|
|
|
2024-09-12 20:32:54 +08:00
|
|
|
<Rectangle x:Name="SelectionRectangle"
|
|
|
|
|
Stroke="Blue"
|
|
|
|
|
StrokeThickness="2"
|
|
|
|
|
Fill="LightBlue"
|
|
|
|
|
Opacity="0.5"
|
|
|
|
|
Panel.ZIndex="999999"
|
|
|
|
|
Visibility="Collapsed"/>
|
|
|
|
|
|
2024-09-10 11:05:48 +08:00
|
|
|
<!-- Top-Left Thumb -->
|
|
|
|
|
<!--<Thumb x:Name="TopLeftThumb"
|
|
|
|
|
Width="10" Height="10"
|
|
|
|
|
DragDelta="Thumb_DragDelta_TopLeft"
|
|
|
|
|
Cursor="SizeNWSE"
|
|
|
|
|
Canvas.Left="0" Canvas.Top="0"/>-->
|
|
|
|
|
|
|
|
|
|
<!-- Top-Right Thumb -->
|
2024-09-10 11:49:56 +08:00
|
|
|
<!--<Thumb x:Name="TopRightThumb"
|
2024-09-10 11:05:48 +08:00
|
|
|
Width="10" Height="10"
|
|
|
|
|
DragDelta="Thumb_DragDelta_TopRight"
|
|
|
|
|
Cursor="SizeNESW"
|
|
|
|
|
Canvas.Left="{Binding ActualWidth, ElementName=FlowChartCanvas, Mode=OneWay, Converter={StaticResource RightThumbPositionConverter}}"
|
2024-09-10 11:49:56 +08:00
|
|
|
Canvas.Top="0"/>-->
|
2024-09-10 11:05:48 +08:00
|
|
|
|
|
|
|
|
<!-- Bottom-Left Thumb -->
|
|
|
|
|
<!--<Thumb x:Name="BottomLeftThumb"
|
|
|
|
|
Width="10" Height="10"
|
|
|
|
|
DragDelta="Thumb_DragDelta_BottomLeft"
|
|
|
|
|
Cursor="SizeNESW"
|
|
|
|
|
Canvas.Left="0"
|
|
|
|
|
Canvas.Top="{Binding ActualHeight, ElementName=FlowChartCanvas, Mode=OneWay, Converter={StaticResource BottomThumbPositionConverter}}"/>-->
|
|
|
|
|
|
|
|
|
|
<!-- Bottom-Right Thumb -->
|
|
|
|
|
<Thumb x:Name="BottomRightThumb"
|
2024-09-17 14:20:27 +08:00
|
|
|
Width="40" Height="40"
|
2024-09-10 11:05:48 +08:00
|
|
|
DragDelta="Thumb_DragDelta_BottomRight"
|
|
|
|
|
Cursor="SizeNWSE"
|
|
|
|
|
Canvas.Left="{Binding ActualWidth, ElementName=FlowChartCanvas, Mode=OneWay, Converter={StaticResource RightThumbPositionConverter}}"
|
|
|
|
|
Canvas.Top="{Binding ActualHeight, ElementName=FlowChartCanvas, Mode=OneWay, Converter={StaticResource BottomThumbPositionConverter}}"/>
|
|
|
|
|
|
|
|
|
|
<!-- Left Thumb -->
|
|
|
|
|
<!--<Thumb x:Name="LeftThumb"
|
|
|
|
|
Width="10" Height="10"
|
|
|
|
|
DragDelta="Thumb_DragDelta_Left"
|
|
|
|
|
Cursor="SizeWE"
|
|
|
|
|
Canvas.Left="0"
|
|
|
|
|
Canvas.Top="{Binding ActualHeight, ElementName=FlowChartCanvas, Mode=OneWay, Converter={StaticResource VerticalCenterThumbPositionConverter}}"/>-->
|
|
|
|
|
|
|
|
|
|
<!-- Right Thumb -->
|
2024-09-10 11:49:56 +08:00
|
|
|
<!--Canvas.Left="{Binding ActualWidth, ElementName=FlowChartCanvas, Mode=OneWay, Converter={StaticResource RightThumbPositionConverter}}"
|
|
|
|
|
Canvas.Top="{Binding ActualHeight, ElementName=FlowChartCanvas, Mode=OneWay, Converter={StaticResource VerticalCenterThumbPositionConverter}}"-->
|
|
|
|
|
<Thumb x:Name="RightThumb" Width="5" Cursor="SizeWE" Canvas.Top="0" Canvas.Right="0" DragDelta="Thumb_DragDelta_Right">
|
|
|
|
|
<Thumb.Template>
|
|
|
|
|
<ControlTemplate>
|
|
|
|
|
<Border Background="#B1B9F8" Width="5" Height="{Binding RelativeSource={RelativeSource AncestorType=Canvas}, Path=ActualHeight}" />
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Thumb.Template>
|
|
|
|
|
</Thumb>
|
2024-09-10 11:05:48 +08:00
|
|
|
|
|
|
|
|
<!-- Top Thumb -->
|
|
|
|
|
<!--<Thumb x:Name="TopThumb"
|
|
|
|
|
Width="10" Height="10"
|
|
|
|
|
DragDelta="Thumb_DragDelta_Top"
|
|
|
|
|
Cursor="SizeNS"
|
|
|
|
|
Canvas.Left="{Binding ActualWidth, ElementName=FlowChartCanvas, Mode=OneWay, Converter={StaticResource HorizontalCenterThumbPositionConverter}}"
|
|
|
|
|
Canvas.Top="0"/>-->
|
|
|
|
|
|
|
|
|
|
<!-- Bottom Thumb -->
|
2024-09-10 11:49:56 +08:00
|
|
|
<!--Canvas.Left="{Binding ActualWidth, ElementName=FlowChartCanvas, Mode=OneWay, Converter={StaticResource HorizontalCenterThumbPositionConverter}}"
|
|
|
|
|
Canvas.Top="{Binding ActualHeight, ElementName=FlowChartCanvas, Mode=OneWay, Converter={StaticResource BottomThumbPositionConverter}}"-->
|
|
|
|
|
<Thumb x:Name="BottomThumb" Height="5" Cursor="SizeNS" Canvas.Bottom="0" Canvas.Left="0" DragDelta="Thumb_DragDelta_Bottom">
|
|
|
|
|
<Thumb.Template>
|
|
|
|
|
<ControlTemplate>
|
|
|
|
|
<Border Background="#B1B9F8" Height="5" Width="{Binding RelativeSource={RelativeSource AncestorType=Canvas}, Path=ActualWidth}" />
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Thumb.Template>
|
|
|
|
|
</Thumb>
|
2024-09-10 11:05:48 +08:00
|
|
|
</Canvas>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</StackPanel>
|
2024-09-09 21:06:47 +08:00
|
|
|
|
|
|
|
|
|
2024-08-05 10:11:58 +08:00
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
</Window>
|