<UserControl x:Class="XHandler.View.SetPlateProperty"
|
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:ctrls="clr-namespace:XHandler.Controls"
|
mc:Ignorable="d"
|
d:DesignHeight="673.034" d:DesignWidth="800"
|
Style="{StaticResource UCStyle}"
|
Loaded="UserControl_Loaded">
|
<UserControl.Resources>
|
<Style TargetType="TextBlock" x:Key="centerAlignmentStyle">
|
<Setter Property="Foreground" Value="Black"/>
|
<Setter Property="FontSize" Value="16"/>
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="TextWrapping" Value="Wrap"/>
|
</Style>
|
|
<!--DataGrid样式-->
|
<Style TargetType="DataGrid">
|
<!--网格线颜色-->
|
<Setter Property="CanUserResizeColumns" Value="false"/>
|
<Setter Property="Background" Value="White" />
|
<Setter Property="BorderBrush" Value="LightGray" />
|
<Setter Property="HorizontalGridLinesBrush">
|
<Setter.Value>
|
<SolidColorBrush Color="LightGray"/>
|
</Setter.Value>
|
</Setter>
|
<Setter Property="VerticalGridLinesBrush">
|
<Setter.Value>
|
<SolidColorBrush Color="Transparent"/>
|
</Setter.Value>
|
</Setter>
|
</Style>
|
|
<!--标题栏样式-->
|
<Style TargetType="DataGridColumnHeader">
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
<Setter Property="MinWidth" Value="0" />
|
<Setter Property="MinHeight" Value="28" />
|
<Setter Property="Foreground" Value="#323433" />
|
<Setter Property="FontSize" Value="16" />
|
<Setter Property="Cursor" Value="Hand" />
|
<Setter Property="Height" Value="40"/>
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="DataGridColumnHeader">
|
<Border x:Name="BackgroundBorder" BorderThickness="0,0,0,0" BorderBrush="LightGray" Width="Auto" Background="{DynamicResource lightGrayBrush}">
|
<Grid >
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="*" />
|
</Grid.ColumnDefinitions>
|
<ContentPresenter Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
</Grid>
|
</Border>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
|
</Style>
|
|
<!--行样式触发-->
|
<!--背景色改变必须先设置cellStyle 因为cellStyle会覆盖rowStyle样式-->
|
<Style TargetType="DataGridRow">
|
<Setter Property="Background" Value="White" />
|
<Setter Property="Height" Value="40"/>
|
<Setter Property="FontSize" Value="16" />
|
<Setter Property="Foreground" Value="Black" />
|
<Style.Triggers>
|
<!--隔行换色-->
|
<!--<Trigger Property="AlternationIndex" Value="0" >
|
<Setter Property="Background" Value="#e7e7e7" />
|
</Trigger>
|
<Trigger Property="AlternationIndex" Value="1" >
|
<Setter Property="Background" Value="#f2f2f2" />
|
</Trigger>-->
|
|
<Trigger Property="IsMouseOver" Value="True">
|
<Setter Property="Background" Value="LightGray"/>
|
<!--<Setter Property="Foreground" Value="White"/>-->
|
</Trigger>
|
|
<Trigger Property="IsSelected" Value="True">
|
<Setter Property="Background" Value="{DynamicResource lightBlueBrush}"/>
|
|
</Trigger>
|
</Style.Triggers>
|
</Style>
|
|
<!--单元格样式触发-->
|
<Style TargetType="DataGridCell">
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="DataGridCell">
|
<TextBlock TextAlignment="Center" VerticalAlignment="Center" >
|
<ContentPresenter />
|
</TextBlock>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
<Style.Triggers>
|
<Trigger Property="IsSelected" Value="True">
|
<Setter Property="Foreground" Value="Black"/>
|
</Trigger>
|
</Style.Triggers>
|
</Style>
|
</UserControl.Resources>
|
<Grid>
|
<Grid.RowDefinitions>
|
<RowDefinition Height="*"/>
|
<RowDefinition Height="auto"/>
|
<RowDefinition Height="*"/>
|
</Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="*"/>
|
</Grid.ColumnDefinitions>
|
<Grid Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="700" Height="660">
|
<Grid.RowDefinitions>
|
<RowDefinition Height="50"/>
|
<RowDefinition Height="*"/>
|
</Grid.RowDefinitions>
|
<Border Grid.Row="0" Background="{DynamicResource blueBrush}" CornerRadius="10 10 0 0" BorderThickness="0">
|
<Grid>
|
<TextBlock Text="{x:Static str:Resources.strSetting}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20 0" FontSize="20"
|
Foreground="White" FontWeight="Bold"/>
|
<Button Content="×" HorizontalAlignment="Right" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="10 0" FontSize="28" Width="40" Height="40"
|
FontWeight="Bold" Foreground="White" Style="{DynamicResource BlueButtonStyle}" Background="{DynamicResource blueBrush}" Click="btnCancel_Click"/>
|
</Grid>
|
</Border>
|
<Border Grid.Row="1" Background="White" CornerRadius="0 0 10 10" BorderThickness="0">
|
<Grid>
|
<Grid.RowDefinitions>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="30"/>
|
<RowDefinition Height="auto"/>
|
<RowDefinition Height="auto"/>
|
<RowDefinition Height="*"/>
|
</Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="120"/>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
<!--<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>-->
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Text="{x:Static str:Resources.strLabel}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 0 5" FontSize="16"/>
|
<TextBox x:Name="textboxLabel" Grid.Row="0" Grid.Column="1" Height="30" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Center" Background="{DynamicResource lightGrayBrush}" Margin="10 0 30 0"
|
BorderThickness="0" BorderBrush="Red">
|
<TextBox.Text>
|
<Binding Path="label" 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="2" x:Name="bdvError" Text="{Binding ElementName=textboxLabel,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16"
|
VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 5 5 0"/>
|
|
<TextBlock Grid.Row="1" Grid.Column="0" Text="{x:Static str:Resources.strBarCode}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 0 5" FontSize="16"/>
|
<TextBox x:Name="textboxBarcode" Grid.Row="1" Grid.Column="1" Height="30" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Center" Background="{DynamicResource lightGrayBrush}" Margin="10 0 30 0"
|
BorderThickness="0" BorderBrush="Red">
|
<TextBox.Text>
|
<Binding Path="labware_barcode" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" >
|
<Binding.ValidationRules>
|
<localL:LiquidsValidationRule ValidateType="1,6@[200]"/>
|
</Binding.ValidationRules>
|
</Binding>
|
</TextBox.Text>
|
</TextBox>
|
|
<TextBlock Grid.Row="1" Grid.Column="2" x:Name="bbError" Text="{Binding ElementName=textboxBarcode,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16"
|
VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 5 5 0"/>
|
|
<TextBlock Grid.Row="2" Grid.Column="0" Text="{x:Static str:Resources.strTablePosition}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 0 5" FontSize="16"/>
|
<TextBox x:Name="textboxTablePosition" Grid.Row="2" Grid.Column="1" Height="30" FontSize="16" VerticalContentAlignment="Center"
|
VerticalAlignment="Center" Margin="10 0 30 0" Background="{DynamicResource lightGrayBrush}" BorderThickness="0" BorderBrush="Red"
|
Text="{Binding position}" IsEnabled="False"/>
|
|
<TextBlock Grid.Row="3" Grid.Column="0" Text="{x:Static str:Resources.strConsumableType}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 0 5" FontSize="16"/>
|
<TextBox x:Name="textboxConsumableType" Grid.Row="3" Grid.Column="1" Height="30" FontSize="16" VerticalContentAlignment="Center"
|
VerticalAlignment="Center" Margin="10 0 30 0" Background="{DynamicResource lightGrayBrush}" BorderThickness="0" BorderBrush="Red"
|
Text="{Binding labware_type}" IsEnabled="False"/>
|
|
<TextBlock Grid.Row="4" Grid.Column="0" Text="{x:Static str:Resources.strWellSetting}" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,2,0,0" FontSize="16"/>
|
<StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal" Margin="10 0 30 0">
|
<Rectangle Fill="{DynamicResource blueBrush}" StrokeThickness="0" Width="30" Height="20"/>
|
<TextBlock Text="{x:Static str:Resources.strValidWells}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10 0 20 0" FontSize="16"/>
|
<Rectangle Fill="White" StrokeThickness="1" Stroke="Gray" Width="30" Height="20"/>
|
<TextBlock Text="{x:Static str:Resources.strInValidWells}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10 0" FontSize="16"/>
|
</StackPanel>
|
|
<Border Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="3" Background="White" BorderBrush="LightGray" BorderThickness="1" CornerRadius="5" Margin="10">
|
<Grid>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width=".8*"/>
|
</Grid.ColumnDefinitions>
|
|
<ctrls:WellPlate x:Name="wellPlate" Grid.Column="0" HorizontalAlignment="Center" Margin="0 10" VerticalAlignment="Top"
|
Selection="{Binding validWells, Mode=TwoWay}"/>
|
|
<Grid Grid.Column="1">
|
<Grid.RowDefinitions>
|
<RowDefinition Height="auto"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
</Grid.RowDefinitions>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="80"/>
|
<ColumnDefinition Width="*"/>
|
</Grid.ColumnDefinitions>
|
|
<DataGrid x:Name="datagrid" AutoGenerateColumns="False" VerticalAlignment="Top" HorizontalAlignment="Center" BorderThickness="0"
|
CanUserSortColumns="False" Grid.Row="0" Grid.ColumnSpan="2" Height="200" Margin="0 10 10 5"
|
CanUserResizeColumns="False" CanUserResizeRows="False"
|
CanUserReorderColumns="False" RowHeaderWidth="0" CanUserAddRows="False" >
|
<DataGrid.Columns>
|
<DataGridTextColumn Width="0.5*" Binding="{Binding Path=nIndex}" Header="{x:Static str:Resources.strSerialNumber}" ElementStyle="{StaticResource centerAlignmentStyle}"/>
|
<DataGridTextColumn Width="*" Binding="{Binding Path=liquidTypeName}" Header="{x:Static str:Resources.strLiquidType}" ElementStyle="{StaticResource centerAlignmentStyle}"/>
|
<DataGridTextColumn Width="*" Binding="{Binding Path=nVolume}" Header="{x:Static str:Resources.strVolumn}" ElementStyle="{StaticResource centerAlignmentStyle}"/>
|
</DataGrid.Columns>
|
</DataGrid>
|
|
<TextBlock Grid.Row="1" Text="{x:Static str:Resources.strLiquidType}" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right"/>
|
<ComboBox x:Name="cbLiquidType" Grid.Row="1" Grid.Column="1" Height="30" BorderThickness="0" Background="{DynamicResource lightGrayBrush}" Margin="10 0 20 0"
|
DisplayMemberPath="liquid_type_name" SelectedValuePath="liquid_type_id" IsEditable="False"/>
|
|
<TextBlock Grid.Row="2" Text="{x:Static str:Resources.strVolumn}" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right"/>
|
<TextBox x:Name="textboxLiquidVolume" Grid.Row="2" Grid.Column="1" Height="30" FontSize="16" VerticalContentAlignment="Center"
|
VerticalAlignment="Center" Margin="10 0 20 0" Background="{DynamicResource lightGrayBrush}" BorderThickness="0" />
|
|
<Button x:Name="btnSet" Grid.Row="3" Grid.Column="1" Content="{x:Static str:Resources.strSetting}" Style="{DynamicResource LinkButton}" Foreground="Black"
|
HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 20 0" FontSize="16" Click="btnSet_Click"/>
|
<Button x:Name="btnReset" Grid.Row="3" Grid.Column="1" Content="{x:Static str:Resources.strReset}" Style="{DynamicResource LinkButton}" Foreground="{DynamicResource blueBrush}"
|
HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 70 0" FontSize="16" Click="btnReset_Click" Visibility="Collapsed"/>
|
</Grid>
|
</Grid>
|
</Border>
|
|
<Button x:Name="btnOK" Grid.Row="7" Grid.Column="2" Content="{x:Static str:Resources.btnOK}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="20 0" FontSize="16" Width="80" Height="40"
|
Foreground="White" Style="{DynamicResource BlueButtonStyle}" Background="{DynamicResource blueBrush}" Click="btnOK_Click"/>
|
<Button Grid.Row="7" Grid.Column="2" Content="{x:Static str:Resources.btnCancel}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 0 120 0" FontSize="16" Width="80" Height="40"
|
Foreground="White" Style="{DynamicResource BlueButtonStyle}" Background="LightGray" Click="btnCancel_Click"/>
|
</Grid>
|
</Border>
|
</Grid>
|
</Grid>
|
</UserControl>
|