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.MethodProperty.DataImportProperty"
             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.MethodProperty"
             xmlns:str="clr-namespace:XHandler.Properties"
             xmlns:ctrls="clr-namespace:XHandler.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static str:Resources.strCommandTag}" FontSize="16"
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
        <TextBlock Grid.Row="1" Grid.Column="0" Text="{x:Static str:Resources.strCommandName}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
        <TextBlock Grid.Row="2" Grid.Column="0" Text="{x:Static str:Resources.strFile}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
        <TextBlock Grid.Row="3" Grid.Column="0" Text="{x:Static str:Resources.strFilePreview}" FontSize="16" 
                   VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0 10 15 0"/>
        <TextBlock Grid.Row="5" Grid.Column="0" Text="{x:Static str:Resources.strFrom}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
        <TextBlock Grid.Row="6" Grid.Column="0" Text="{x:Static str:Resources.strSourceBoardCode}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
        <TextBlock Grid.Row="7" Grid.Column="0" Text="{x:Static str:Resources.strSourceWell}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 15 0"/>
 
 
        <TextBox Grid.Row="0" Grid.Column="1" x:Name="tbxCommandLabel" Height="30" FontSize="16" VerticalContentAlignment="Center" BorderThickness="0" Background="{DynamicResource lightGrayBrush}"
                 Text="{Binding label, Mode=TwoWay}" IsEnabled="False"/>
        <TextBox Grid.Row="1" Grid.Column="1" x:Name="tbxCommandName" Height="30" FontSize="16" VerticalContentAlignment="Center" BorderThickness="0" Background="{DynamicResource lightGrayBrush}"
                 Text="{Binding name}" TextChanged="tbxCommandName_TextChanged"/>
        <TextBlock Grid.Row="1" Grid.Column="2" x:Name="xcError" Text="{Binding  ElementName=tbxCommandName,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5 5 5 0"/>
        <TextBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" x:Name="tbExcelFile" Height="30" FontSize="16" VerticalContentAlignment="Center" Margin="0 0 40 0"
                 BorderThickness="0" Background="{DynamicResource lightGrayBrush}" TextChanged="tbExcelFile_TextChanged" PreviewKeyDown="tbExcelFile_PreviewKeyDown"/>
        <ctrls:ImageButton Grid.Row="2" Grid.Column="3" x:Name="btnSelectFile" NormalImage="pack://application:,,,./Assets/CmdSet/文件.png" Width="40" Height="30" ImageWidth="32" ImageHeight="32" 
                           HorizontalAlignment="Right" VerticalAlignment="Center" Background="{DynamicResource lightGrayBrush}"
                           Click="btnSelectFile_Click"/>
        
        <Border Grid.Row="3" Grid.Column="1" Grid.RowSpan="2" Grid.ColumnSpan="3" Background="{DynamicResource lightGrayBrush}" CornerRadius="5" Margin="0 5 0 5">
            <DataGrid x:Name="dgTransferFileData" AutoGenerateColumns="True" IsReadOnly="True" BorderThickness="1" FontSize="14" Height="280"
                      RowHeaderWidth="0" BorderBrush="LightGray" CanUserResizeColumns="False" CanUserResizeRows="False" 
                      CanUserSortColumns="False" CanUserReorderColumns="False" CanUserAddRows="False"></DataGrid>
        </Border>
 
        <!--<ComboBox Grid.Row="5" Grid.Column="1" Height="30" BorderThickness="0" Background="{DynamicResource lightGrayBrush}" />-->
        <TextBox Grid.Row="5" Grid.Column="1" x:Name="tbxbeginLine" FontSize="16" VerticalContentAlignment="Center" Height="30" Margin="0 0 0 0" BorderThickness="0" Background="{DynamicResource lightGrayBrush}"
                         Text="{Binding beginLine, Mode=TwoWay}" TextChanged="tbxbeginLine_TextChanged"/>
        <TextBlock Grid.Row="5" Grid.Column="3" x:Name="blError" Text="{Binding  ElementName=tbxbeginLine,Path=(Validation.Errors)[0].ErrorContent}" Foreground="Red" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5 5 5 0"/>
        <TextBlock Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="2" Text="{x:Static str:Resources.strBeginReadData}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Left" Margin="15 0 15 0"/>
 
        <ComboBox x:Name="cbSourceBoardCode" Grid.Row="6" Grid.Column="1" Height="30" BorderThickness="0" Background="{DynamicResource lightGrayBrush}" 
                  DisplayMemberPath="header_name" SelectionChanged="cbSourceBoardCode_SelectionChanged" IsEditable="False"/>
        <TextBlock Grid.Row="6" Grid.Column="2" Text="{x:Static str:Resources.strSourceBoard}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 0 0 0"/>
        <ComboBox x:Name="cbSourceBoard" Grid.Row="6" Grid.Column="3" Height="30" BorderThickness="0" Background="{DynamicResource lightGrayBrush}" 
                  DisplayMemberPath="header_name" SelectionChanged="cbSourceBoard_SelectionChanged" IsEditable="False"/>
 
        <ComboBox x:Name="cbSourceWell" Grid.Row="7" Grid.Column="1" Height="30" BorderThickness="0" Background="{DynamicResource lightGrayBrush}" 
                  DisplayMemberPath="header_name" SelectionChanged="cbSourceWell_SelectionChanged" IsEditable="False"/>
        <TextBlock Grid.Row="7" Grid.Column="2" Text="{x:Static str:Resources.strVolumn}" FontSize="16" 
                   VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 0 0 0"/>
        <ComboBox x:Name="cbVolumn" Grid.Row="7" Grid.Column="3" Height="30" BorderThickness="0" Background="{DynamicResource lightGrayBrush}"
                  DisplayMemberPath="header_name" SelectionChanged="cbVolumn_SelectionChanged" IsEditable="False"/>
    </Grid>
</UserControl>