<UserControl x:Class="XHandler.View.LiquidManagement"
|
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:localL="clr-namespace:XHandler.View.Liquids"
|
xmlns:str="clr-namespace:XHandler.Properties"
|
xmlns:liq="clr-namespace:XHandler.View.Liquids"
|
xmlns:data="clr-namespace:XHandler.Class.DataEx"
|
xmlns:dt ="clr-namespace:XImagingXhandler.XDAL;assembly=DataEntity"
|
mc:Ignorable="d"
|
d:DesignHeight="450" d:DesignWidth="800"
|
Loaded="UserControl_Loaded">
|
<UserControl.Resources>
|
<PathGeometry x:Key="TreeArrow" Figures="M0,0 L0,6 L6,0 z"/>
|
<Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}">
|
<Setter Property="Focusable" Value="False"/>
|
<Setter Property="Width" Value="16"/>
|
<Setter Property="Height" Value="16"/>
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
<Border Background="Transparent" Height="16" Padding="5,5,5,5" Width="16">
|
<Path x:Name="ExpandPath" Data="{StaticResource TreeArrow}" Fill="Transparent" Stroke="#FF989898">
|
<Path.RenderTransform>
|
<RotateTransform Angle="135" CenterY="3" CenterX="3"/>
|
</Path.RenderTransform>
|
</Path>
|
</Border>
|
<ControlTemplate.Triggers>
|
<Trigger Property="IsMouseOver" Value="True">
|
<Setter Property="Stroke" TargetName="ExpandPath" Value="#FF1BBBFA"/>
|
<Setter Property="Fill" TargetName="ExpandPath" Value="Transparent"/>
|
</Trigger>
|
<Trigger Property="IsChecked" Value="True">
|
<Setter Property="RenderTransform" TargetName="ExpandPath">
|
<Setter.Value>
|
<RotateTransform Angle="180" CenterY="3" CenterX="3"/>
|
</Setter.Value>
|
</Setter>
|
<Setter Property="Fill" TargetName="ExpandPath" Value="#FF595959"/>
|
<Setter Property="Stroke" TargetName="ExpandPath" Value="#FF262626"/>
|
</Trigger>
|
</ControlTemplate.Triggers>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
</Style>
|
|
<Style x:Key="TreeViewItemFocusVisual" TargetType="{x:Type TreeViewItem}">
|
|
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
|
|
<!--<Setter Property="TextBlock.FontWeight" Value="Bold"></Setter>
|
<Setter Property="Control.Template">
|
<Setter.Value>
|
<ControlTemplate>
|
<Rectangle Margin="-2" StrokeThickness="1" Stroke="Red" StrokeDashArray="1 2"/>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>-->
|
</Style>
|
|
<Style x:Key="treeViewItemStyle" TargetType="{x:Type TreeViewItem}">
|
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
<Setter Property="VerticalContentAlignment" Value="{Binding Path=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="IsExpanded" Value="{Binding IsExpanded}"/>
|
<Setter Property="IsSelected" Value="{Binding IsSelected}"/>
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="{x:Type TreeViewItem}">
|
<Grid>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition MinWidth="16" Width="Auto"/>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="Auto"/>
|
</Grid.ColumnDefinitions>
|
<Grid.RowDefinitions>
|
<RowDefinition Height="30"/>
|
<RowDefinition/>
|
</Grid.RowDefinitions>
|
<Border x:Name="BdBack" Margin="1" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" CornerRadius="3" Background="Transparent"></Border>
|
<ToggleButton x:Name="Expander" Grid.Row="0" Grid.Column="0" Style="{StaticResource ExpandCollapseToggleStyle}" ClickMode="Press" IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}"/>
|
<Border x:Name="Bd" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" CornerRadius="3" SnapsToDevicePixels="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
|
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" x:Name="PART_Header" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header"/>
|
</Border>
|
<ItemsPresenter x:Name="ItemsHost" Grid.Column="1" Grid.Row="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="Background" TargetName="Bd" Value="{DynamicResource listSelectedBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}}"/>
|
</Trigger>
|
<!--<MultiTrigger>
|
<MultiTrigger.Conditions>
|
<Condition Property="IsSelected" Value="true"/>
|
<Condition Property="IsSelectionActive" Value="false"/>
|
</MultiTrigger.Conditions>
|
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource lightBlueBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}}"/>
|
</MultiTrigger>-->
|
<Trigger Property="IsEnabled" Value="false">
|
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
|
</Trigger>
|
<MultiTrigger>
|
<MultiTrigger.Conditions>
|
<Condition Property="IsMouseOver" Value="true" SourceName="Bd"/>
|
<Condition Property="IsSelected" Value="false"/>
|
</MultiTrigger.Conditions>
|
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource lightBlueBrush}"/>
|
<!--<Setter Property="BorderBrush" TargetName="BdBack" Value="{DynamicResource lightBlueBrush}" />-->
|
</MultiTrigger>
|
</ControlTemplate.Triggers>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
<EventSetter Event="PreviewMouseRightButtonDown" Handler="TreeViewItem_PreviewMouseRightButtonDown"/>
|
</Style>
|
|
<HierarchicalDataTemplate x:Key="treeviewTemplate" DataType="{x:Type data:LiquidItemExEx}" ItemsSource="{Binding Children}">
|
<!--<Border Width="auto" Height="56" Margin="{Binding Level, Converter={StaticResource leverToThicknessConvert}}">-->
|
<Grid>
|
<!--<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="42"/>
|
<ColumnDefinition Width="50"/>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
</Grid.ColumnDefinitions>-->
|
<TextBlock Grid.Column="0" Foreground="Black" FontSize="16" Text="{Binding Name}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0" />
|
<Image Name="idImage" Source="pack://application:,,,./Assets/Consumables/default.png" HorizontalAlignment="Left"
|
VerticalAlignment="Top" Height="20" Visibility="{Binding nDefault, Converter={StaticResource intToVisibleConvert}}"/>
|
</Grid>
|
<!--</Border>-->
|
</HierarchicalDataTemplate>
|
|
<HierarchicalDataTemplate DataType="{x:Type data:LiquidRangeExEx}" ItemsSource="{Binding Path=Chirldren}">
|
<TextBlock Text="{Binding liquid_range_name}" FontSize="16"/>
|
</HierarchicalDataTemplate>
|
|
<HierarchicalDataTemplate x:Key="headType" DataType="{x:Type data:HeadTypeExEx}" ItemsSource="{Binding Children}">
|
<TextBlock Text="{Binding name}" FontSize="16"/>
|
</HierarchicalDataTemplate>
|
|
<!--<HierarchicalDataTemplate DataType="{x:Type dt:Liquid}" ItemsSource="{Binding Children}">
|
<TextBlock Text="{Binding name}" FontSize="16"/>
|
</HierarchicalDataTemplate>-->
|
<DataTemplate DataType="{x:Type dt:Liquid}">
|
<TextBlock Text="{Binding liquid_name}" FontSize="16"/>
|
|
</DataTemplate>
|
|
<!--#region menu-->
|
<ContextMenu x:Key="liquidMenu" Width="200">
|
<MenuItem Name="menuCopy" Header="{x:Static str:Resources.strCopy}" Click="menuCopy_Click"/>
|
<MenuItem Name="menuPaste" Header="{x:Static str:Resources.strPaste}" Click="menuPaste_Click" IsEnabled="False"/>
|
<!--<MenuItem Name="menuEdit" Header="{x:Static str:Resources.strEdit}" Click="menuEdit_Click"/>-->
|
<MenuItem Name="menuDelete" Header="{x:Static str:Resources.strDelete}" Click="menuDelete_Click"/>
|
</ContextMenu>
|
|
<!--#endregion-->
|
</UserControl.Resources>
|
|
<Grid>
|
<Border Background="White" CornerRadius="0,10,10,0" Margin="0,0,10,0" >
|
<Grid>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="2.5*"/>
|
<ColumnDefinition Width="7.5*"/>
|
</Grid.ColumnDefinitions>
|
|
<Border Grid.Row="0" Background="{DynamicResource lightGrayBrush}" CornerRadius="5" BorderThickness="0" Margin="10">
|
<Grid>
|
<Grid.RowDefinitions>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="*"/>
|
</Grid.RowDefinitions>
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static str:Resources.strAllCategory}" FontSize="16" FontWeight="Bold"
|
Margin="10 0 0 0" VerticalAlignment="Center"/>
|
|
<TreeView x:Name="treeviewLiquid" Grid.Row="1" Margin="10 0 10 10"
|
Background="White"
|
ItemContainerStyle="{DynamicResource treeViewItemStyle}"
|
ItemTemplate="{DynamicResource treeviewTemplate}"
|
BorderThickness="0" ScrollViewer.VerticalScrollBarVisibility="Auto"
|
SelectedItemChanged="treeviewLiquid_SelectedItemChanged"
|
ContextMenu="{DynamicResource liquidMenu}"/>
|
|
</Grid>
|
</Border>
|
|
<Grid Grid.Column="1">
|
<Grid.RowDefinitions>
|
<RowDefinition Height="auto"/>
|
<RowDefinition Height="60"/>
|
<RowDefinition Height="*"/>
|
</Grid.RowDefinitions>
|
|
<Grid x:Name="gdBaseLiquid" Grid.Row="0" Height="200" IsEnabled="{Binding is_default_type, Converter={StaticResource intToEnableConvert}}">
|
<Grid.RowDefinitions>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="*"/>
|
</Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
</Grid.ColumnDefinitions>
|
|
<!--名称-->
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static str:Resources.strName}" VerticalAlignment="Bottom" Margin="20 0 0 0" FontSize="16"/>
|
<TextBox x:Name="tbliquid_name" Grid.Row="1" Grid.Column="0" Height="30" FontSize="16" VerticalContentAlignment="Center"
|
VerticalAlignment="Top" Background="{DynamicResource lightGrayBrush}" Margin="20 0" BorderThickness="0" >
|
<TextBox.Text>
|
<Binding Path="liquid_name" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" >
|
<Binding.ValidationRules>
|
<localL:LiquidsValidationRule ValidateType="1,6@[200]"/>
|
</Binding.ValidationRules>
|
</Binding>
|
</TextBox.Text>
|
</TextBox>
|
<TextBlock Grid.Row="0" Grid.Column="0" x:Name="bdvError" Text="{Binding ElementName=tbliquid_name,Path=(Validation.Errors)[0].ErrorContent}"
|
Foreground="Red" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 5 5 0"/>
|
|
<!--液体类型-->
|
<TextBlock Grid.Row="0" Grid.Column="1" Text="{x:Static str:Resources.strLiquidType}" VerticalAlignment="Bottom" Margin="20 0 0 0" FontSize="16"/>
|
<ComboBox x:Name="cbLiquidType" Grid.Row="1" Grid.Column="1" Height="30" Width="200" BorderThickness="0" Background="{DynamicResource lightGrayBrush}" HorizontalAlignment="Left"
|
DisplayMemberPath="liquid_type_name" SelectedValuePath="liquid_type_id" SelectionChanged="cbLiquidType_SelectionChanged" Margin="20 0 0 0" IsEnabled="False" IsEditable="False"/>
|
|
<!--枪头类型-->
|
<TextBlock Grid.Row="0" Grid.Column="2" Text="{x:Static str:Resources.strTipsType1}" VerticalAlignment="Bottom" Margin="20 0 0 0" FontSize="16"/>
|
<ComboBox x:Name="cbLiquidRange" Grid.Row="1" Grid.Column="2" Height="30" Width="200" BorderThickness="0" Background="{DynamicResource lightGrayBrush}" HorizontalAlignment="Left"
|
DisplayMemberPath="liquid_range_name" SelectedValuePath="liquid_range_id" SelectionChanged="cbLiquidRange_SelectionChanged" Margin="20 0 0 0" IsEnabled="False"/>
|
|
<!--移液量程-->
|
<TextBlock Grid.Row="0" Grid.Column="3" Text="{x:Static str:Resources.strLiquidRange}" VerticalAlignment="Bottom" Margin="20 0 0 0" FontSize="16"/>
|
<ComboBox x:Name="cbLiquidArm" Grid.Row="1" Grid.Column="3" Height="30" Width="200" BorderThickness="0" Background="{DynamicResource lightGrayBrush}" HorizontalAlignment="Left"
|
DisplayMemberPath="head_type" SelectedValuePath="device_arm_id" SelectionChanged="cbLiquidArm_SelectionChanged" Margin="20 0 0 0" IsEnabled="False"/>
|
|
<!--描述-->
|
<TextBlock Grid.Row="2" Grid.Column="0" Text="{x:Static str:Resources.strDescription}" VerticalAlignment="Bottom" Margin="20 0 0 0" FontSize="16"/>
|
<TextBox x:Name="tbcontent" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" FontSize="16" VerticalContentAlignment="Top" Margin="20 8" Background="{DynamicResource lightGrayBrush}"
|
TextWrapping="Wrap" BorderThickness="0" >
|
<TextBox.Text>
|
<Binding Path="content" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" >
|
<Binding.ValidationRules>
|
<localL:LiquidsValidationRule ValidateType="1,6@[200]"/>
|
</Binding.ValidationRules>
|
</Binding>
|
</TextBox.Text>
|
</TextBox>
|
<TextBlock Grid.Row="2" Grid.Column="0" x:Name="bError" Text="{Binding ElementName=tbcontent,Path=(Validation.Errors)[0].ErrorContent}"
|
Foreground="Red" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 5 5 0"/>
|
</Grid>
|
|
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
|
<!--吸液参数-->
|
<RadioButton x:Name="rbAspirateParam" Width="120" Height="40" Style="{DynamicResource TxTRadioButtonSytle}" Content="{x:Static str:Resources.strAspirateParam}"
|
FontSize="20" FontWeight="Black" Background="White" Margin="0 0 40 0" HorizontalAlignment="Center"
|
VerticalContentAlignment="Center" Checked="rbAspirateParam_Checked"/>
|
<!--加液参数-->
|
<RadioButton x:Name="rbDispenseParam" Width="120" Height="40" Style="{DynamicResource TxTRadioButtonSytle}" Content="{x:Static str:Resources.strDispenseParam}"
|
FontSize="20" FontWeight="Black" Background="White" Margin="0 0 20 0" HorizontalAlignment="Center"
|
VerticalContentAlignment="Center" Checked="rbDispenseParam_Checked"/>
|
<!--校准-->
|
<RadioButton x:Name="rbCelibrate" Width="120" Height="40" Style="{DynamicResource TxTRadioButtonSytle}" Content="{x:Static str:Resources.strCalibrate}"
|
FontSize="20" FontWeight="Black" Background="White" Margin="0 0 20 0" HorizontalAlignment="Center"
|
VerticalContentAlignment="Center" Checked="rbCelibrate_Checked"/>
|
</StackPanel>
|
|
<ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
|
<Grid x:Name="gridParam" IsEnabled="{Binding is_default_type, Converter={StaticResource intToEnableConvert}}">
|
<!--<liq:AspirateParam/>-->
|
<!--<liq:DispenseParam/>-->
|
<!--<liq:CalibrationParam/>-->
|
</Grid>
|
</ScrollViewer>
|
</Grid>
|
</Grid>
|
|
</Border>
|
</Grid>
|
</UserControl>
|