schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<UserControl x:Class="XHandler.View.Consumables.LatticeSetting"
             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.Consumables"
             xmlns:str="clr-namespace:XHandler.Properties"
             xmlns:ctrls="clr-namespace:XHandler.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="2000" d:DesignWidth="800" SnapsToDevicePixels="True"
             Loaded="UserControl_Loaded">
    <Grid IsEnabled="{Binding is_default_type, Converter={StaticResource intToEnableConvert}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="40"/>
 
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static str:Resources.strLatticeSize}" VerticalAlignment="Center"
                               FontSize="16" Margin="20 0 0 0" FontWeight="Bold"/>
            <TextBlock Grid.Row="1" Grid.Column="0" Text="L (mm)" VerticalAlignment="Center" FontSize="16" Margin="20 0 0 0"/>
            <TextBlock Grid.Row="1" Grid.Column="1" Text="W (mm)" VerticalAlignment="Center" FontSize="16" Margin="20 0 0 0"/>
            <TextBox x:Name="tblabware_length" Grid.Row="2" Grid.Column="0" Height="30" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Top" Background="{DynamicResource lightGrayBrush}" Margin="20 0"
                     BorderThickness="0" >
                <TextBox.Text>
                    <Binding Path="labware_length" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" >
                        <Binding.ValidationRules>
                            <local:ConsumablesValidationRule  ValidateType="1,4@[2],5@[0-1000]"/>
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <TextBlock Grid.Row="1" Grid.Column="0" x:Name="lLError" Text="{Binding  ElementName=tblabware_length,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 5 5 0"/>
 
            <TextBox x:Name="tblabware_width" Grid.Row="2" Grid.Column="1" Height="30" FontSize="16" VerticalContentAlignment="Center" VerticalAlignment="Top" Background="{DynamicResource lightGrayBrush}" Margin="20 0"
                     BorderThickness="0" >
                <TextBox.Text>
                    <Binding Path="labware_width" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True" >
                        <Binding.ValidationRules>
                            <local:ConsumablesValidationRule  ValidateType="1,4@[2],5@[0-1000]"/>
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <TextBlock Grid.Row="1" Grid.Column="1" x:Name="lWError" Text="{Binding  ElementName=tblabware_width,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5 5 5 0"/>
        </Grid>
    </Grid>
</UserControl>