<UserControl x:Class="XHandler.View.RunWnd"
|
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:XHandler.View"
|
xmlns:str="clr-namespace:XHandler.Properties"
|
xmlns:cls ="clr-namespace:XHandler.Class.DataEx"
|
xmlns:ctrls="clr-namespace:XHandler.Controls"
|
mc:Ignorable="d"
|
d:DesignHeight="450" d:DesignWidth="1920"
|
Loaded="UserControl_Loaded">
|
|
<UserControl.Resources>
|
<SolidColorBrush x:Key="ListBox.Static.Background" Color="#FFFFFFFF"/>
|
<SolidColorBrush x:Key="ListBox.Static.Border" Color="#FFABADB3"/>
|
<SolidColorBrush x:Key="ListBox.Disabled.Background" Color="#FFFFFFFF"/>
|
<SolidColorBrush x:Key="ListBox.Disabled.Border" Color="#FFD9D9D9"/>
|
<Style x:Key="logListBoxStyle" TargetType="{x:Type ListBox}">
|
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
<Setter Property="Background" Value="{StaticResource ListBox.Static.Background}"/>
|
<Setter Property="BorderBrush" Value="{StaticResource ListBox.Static.Border}"/>
|
<Setter Property="BorderThickness" Value="0"/>
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
|
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="{x:Type ListBox}">
|
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="1" SnapsToDevicePixels="true">
|
<ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
|
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
</ScrollViewer>
|
</Border>
|
<ControlTemplate.Triggers>
|
<Trigger Property="IsEnabled" Value="false">
|
<Setter Property="Background" TargetName="Bd" Value="{StaticResource ListBox.Disabled.Background}"/>
|
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ListBox.Disabled.Border}"/>
|
</Trigger>
|
<MultiTrigger>
|
<MultiTrigger.Conditions>
|
<Condition Property="IsGrouping" Value="true"/>
|
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
|
</MultiTrigger.Conditions>
|
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
|
</MultiTrigger>
|
</ControlTemplate.Triggers>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
<Setter Property="ItemsPanel">
|
<Setter.Value>
|
<ItemsPanelTemplate>
|
<StackPanel/>
|
</ItemsPanelTemplate>
|
</Setter.Value>
|
</Setter>
|
<Setter Property="ItemContainerStyle">
|
<Setter.Value>
|
<Style TargetType="ListBoxItem">
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="ListBoxItem">
|
<Border x:Name="Border" Margin="0" Height="30" BorderThickness="0" Padding="1" Background="{TemplateBinding Background}">
|
<TextBlock Text="{TemplateBinding Content}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10 0"/>
|
</Border>
|
<ControlTemplate.Triggers>
|
<Trigger Property="IsMouseOver" Value="True" >
|
<Setter TargetName="Border" Property="Background" Value="{DynamicResource lightBlueBrush}"></Setter>
|
</Trigger>
|
</ControlTemplate.Triggers>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
</Style>
|
</Setter.Value>
|
</Setter>
|
</Style>
|
|
<Style x:Key="runTreeViewItemStyle" TargetType="{x:Type TreeViewItem}">
|
<Setter Property="IsSelected" Value="{Binding isSelected, Mode=TwoWay}"/>
|
<Setter Property="IsExpanded" Value="True"/>
|
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
|
<Setter Property="Padding" Value="1,0,0,0"/>
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
<Setter Property="Focusable" Value="False"/>
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="{x:Type TreeViewItem}">
|
<Grid>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition MinWidth="1" Width="auto"/>
|
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="*"/>
|
</Grid.ColumnDefinitions>
|
<Grid.RowDefinitions>
|
<RowDefinition Height="Auto"/>
|
<RowDefinition/>
|
</Grid.RowDefinitions>
|
<ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Visibility="Collapsed"/>
|
<Rectangle x:Name="Hd" Grid.Column="1" Fill="{DynamicResource blueBrush}" Opacity="0" Width="5"/>
|
<Border x:Name="Bd" Grid.Column="2" BorderThickness="0 0 0 2" Background="{Binding IsError, Converter={StaticResource methodBackgroundConvert}}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
<Border.BorderBrush>
|
<VisualBrush>
|
<VisualBrush.Visual>
|
<Rectangle StrokeDashArray="4 4" Stroke="LightGray" StrokeThickness="1"
|
Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
|
Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}"/>
|
</VisualBrush.Visual>
|
</VisualBrush>
|
</Border.BorderBrush>
|
|
<ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
</Border>
|
|
<ItemsPresenter x:Name="ItemsHost" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" />
|
</Grid>
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsExpanded" Value="false">
|
<Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
|
</Trigger>
|
<Trigger Property="HasItems" Value="false">
|
<Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>
|
</Trigger>
|
<Trigger Property="IsSelected" Value="true">
|
<Setter Property="Opacity" TargetName="Hd" Value="1"/>
|
<Setter Property="Background" TargetName="Bd" Value="{Binding IsError, Converter={StaticResource methodSelectedBackgroundConvert}}"/>
|
<!--<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>-->
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="false">
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
</Trigger>
|
</ControlTemplate.Triggers>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
<Style.Triggers>
|
<Trigger Property="VirtualizingPanel.IsVirtualizing" Value="False">
|
<Setter Property="ItemsPanel">
|
<Setter.Value>
|
<ItemsPanelTemplate>
|
<VirtualizingStackPanel/>
|
</ItemsPanelTemplate>
|
</Setter.Value>
|
</Setter>
|
</Trigger>
|
</Style.Triggers>
|
</Style>
|
|
<HierarchicalDataTemplate x:Key="runTreeviewTemplate" DataType="{x:Type cls:MethodExEx}" ItemsSource="{Binding Children}">
|
<Border Width="auto" Height="56" Margin="{Binding Level, Converter={StaticResource leverToThicknessConvert}}">
|
<Grid>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="50"/>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
</Grid.ColumnDefinitions>
|
<TextBlock Grid.Column="0" FontSize="14" Text="{Binding strIndex}" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Bold"
|
Foreground="{Binding isEnabled, Converter={StaticResource enableToBrush}}" Margin="10 0"/>
|
<Image Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Stretch="Uniform" Height="32">
|
<Image.Source>
|
<MultiBinding Converter="{StaticResource workflowIconMultiConvert}">
|
<Binding Path="method_ico"/>
|
<Binding Path="isEnabled"/>
|
<Binding Path="method_group_id"/>
|
</MultiBinding>
|
</Image.Source>
|
</Image>
|
|
<TextBlock Grid.Column="2" FontSize="16" Text="{Binding method_name}" VerticalAlignment="Center"
|
Foreground="{Binding isEnabled, Converter={StaticResource enableToBrush}}"/>
|
<TextBlock Grid.Column="3" FontSize="14" Margin="20,0,0,0" HorizontalAlignment="Left" Text="{Binding method_Tipcontent}" VerticalAlignment="Center"
|
Foreground="{Binding isEnabled, Converter={StaticResource enableToBrush}}" TextWrapping="WrapWithOverflow"/>
|
</Grid>
|
</Border>
|
</HierarchicalDataTemplate>
|
|
<ContextMenu x:Key="workflowMenu" Width="150">
|
<MenuItem x:Name="workflowMenuRunStatus" Header="{x:Static str:Resources.strSubMethodDetail}" Click="workflowMenuRunStatus_Click"/>
|
</ContextMenu>
|
</UserControl.Resources>
|
|
<Grid Background="White">
|
<Border Background="White" Margin="20,10" CornerRadius="6">
|
<Grid>
|
<Grid.RowDefinitions>
|
<RowDefinition Height="50"/>
|
<RowDefinition Height="*"/>
|
</Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="0.6*"/>
|
<ColumnDefinition Width="0.4*"/>
|
</Grid.ColumnDefinitions>
|
<StackPanel Orientation="Horizontal" Margin="10 0" >
|
<TextBlock Text="{x:Static str:Resources.strRunDetail}" FontSize="20" VerticalAlignment="Center" FontWeight="Bold"/>
|
</StackPanel>
|
|
<Button Grid.Column="1" Content="×" HorizontalAlignment="Right" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="10 0" FontSize="28" Width="40" Height="40"
|
FontWeight="Bold" Foreground="Black" Style="{DynamicResource BlueButtonStyle}" Background="White" Click="Button_Click" Visibility="Hidden"/>
|
<Rectangle Grid.ColumnSpan="2" Height="1" StrokeThickness="0" Fill="LightGray" Margin="10 0" VerticalAlignment="Bottom"/>
|
|
<Grid Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Right">
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="0.2*" MaxWidth="120" MinWidth="60"/>
|
<ColumnDefinition Width="0.2*" MaxWidth="120" MinWidth="60"/>
|
<ColumnDefinition Width="0.2*" MaxWidth="120" MinWidth="60"/>
|
<ColumnDefinition Width="0.1*"/>
|
<ColumnDefinition Width="0.3*"/>
|
</Grid.ColumnDefinitions>
|
|
<ctrls:ImageButton x:Name="btnPlay" Grid.Column="0" NormalImage="pack://application:,,,./Assets/Run/play.png" DisabledImage="pack://application:,,,./Assets/Run/playdisable.png"
|
ImageWidth="32" ImageHeight="32" Width="40" Height="40" HorizontalAlignment="Left" Click="btnPlay_Click" ToolTip="开始"/>
|
<ctrls:ImageButton x:Name="btnPause" Grid.Column="1" NormalImage="pack://application:,,,./Assets/Run/pausedisable.png" DisabledImage="pack://application:,,,./Assets/Run/pausedisable.png"
|
ImageWidth="32" ImageHeight="32" Width="40" Height="40" HorizontalAlignment="Left" Click="btnPause_Click" ToolTip="暂停/继续"/>
|
<ctrls:ImageButton x:Name="btnStop" Grid.Column="2" NormalImage="pack://application:,,,./Assets/Run/stopdisable.png" DisabledImage="pack://application:,,,./Assets/Run/stopdisable.png"
|
ImageWidth="32" ImageHeight="32" Width="40" Height="40" HorizontalAlignment="Left" Click="btnStop_Click" ToolTip="停止"/>
|
|
<!--运行提示-->
|
<TextBlock x:Name="tbxRunTip" Grid.Column="3" Text="" FontSize="16" Width="100" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="20 0" FontWeight="Bold" Foreground="Red"/>
|
|
<Button x:Name="btnGoBack" Grid.Column="4" Content="{x:Static str:Resources.btnGoBack}" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="16" Width="120" Height="40"
|
Foreground="White" Margin="0 0 40 0" Style="{DynamicResource BlueButtonStyle}" Background="{DynamicResource blueBrush}" Click="btnGoBack_Click"/>
|
|
</Grid>
|
|
<Grid Grid.Row="1" Grid.Column="0" Margin="20 0">
|
<Grid.RowDefinitions>
|
<RowDefinition Height="50"/>
|
<RowDefinition Height="*"/>
|
<RowDefinition Height="30"/>
|
<RowDefinition Height=".7*"/>
|
</Grid.RowDefinitions>
|
<!--模拟运行-->
|
<TextBlock Grid.Row="0" x:Name="tbxRunTitle" Text="{x:Static str:Resources.strSimulatorRun}" FontSize="16" VerticalAlignment="Top" Margin="10 10 0 0"/>
|
<!--台面布局-->
|
<Grid Grid.Row="1" x:Name="gridTable" Margin="50 5" Loaded="gridTable_Loaded"></Grid>
|
<Image Grid.Row="1" x:Name="imgdish" Margin="0 10 60 0" HorizontalAlignment="Right" VerticalAlignment="Top" Source="/Assets/dish.png" Stretch="Fill" />
|
|
<!--运行日志-->
|
<TextBlock Grid.Row="2" Text="{x:Static str:Resources.strRunLog}" FontSize="16" VerticalAlignment="Center" Margin="10 0"/>
|
<Button Content="run" Grid.Row="2" Height="30" Width="80" HorizontalAlignment="Right" Click="Button_Click_1" Margin="0 0 100 0"
|
Visibility="Hidden"/>
|
<Button Content="error" Grid.Row="2" Height="30" Width="80" HorizontalAlignment="Right" Click="Button_Click_3" Visibility="Hidden"/>
|
<ListBox x:Name="logListbox" Grid.Row="3" Margin="50 5 50 20" Background="{DynamicResource lightGrayBrush}" Style="{DynamicResource logListBoxStyle}"/>
|
</Grid>
|
|
<Grid Grid.Row="1" Grid.Column="1">
|
<!--流程跟踪-->
|
<TextBlock Grid.Row="2" Text="{x:Static str:Resources.strWorkFlowTrace}" FontSize="16" VerticalAlignment="Top" Margin="10 10 0 0 "/>
|
<TreeView x:Name="runTreeviewWorkflow" Grid.Row="1" Margin="10 40 10 10" Background="White"
|
ItemContainerStyle="{DynamicResource runTreeViewItemStyle}" ItemTemplate="{DynamicResource runTreeviewTemplate}" BorderThickness="0" AllowDrop="True"
|
ContextMenu="{DynamicResource workflowMenu}" PreviewMouseRightButtonDown="runTreeviewWorkflow_PreviewMouseRightButtonDown">
|
</TreeView>
|
</Grid>
|
</Grid>
|
</Border>
|
</Grid>
|
</UserControl>
|