<Window x:Class="MeterVision.Stand.AppendFromExcel"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MeterVision.Stand"
        mc:Ignorable="d"
        ShowInTaskbar="False"
        ResizeMode="NoResize"
        Background="WhiteSmoke"
        WindowStartupLocation="CenterOwner"
        Title="从Excel追加数据" Height="180" Width="320">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="40" />
        </Grid.RowDefinitions>

        <Border Grid.Row="0" BorderBrush="#D3D3D3" BorderThickness="1" Margin="10 10 10 0" Background="White">
            <!-- Excel文件选择区域，初始时隐藏 -->
            <StackPanel Grid.Row="0" Orientation="Vertical" Margin="20,20,20,0" Visibility="Visible" x:Name="ExcelImportPanel">
                <TextBlock Text="请选择Excel:" HorizontalAlignment="Left" VerticalAlignment="Center" 
                               FontSize="14px" Foreground="#333333" Margin="0 0 0 5"  />
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBox Name="txtExcelFile" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Center"
                                 IsReadOnly="True"
                                 Foreground="#000000" Padding="2" FontSize="14px" Margin="0,0,2,0"/>
                    <Button Name="btnImportExcel" Grid.Column="1" Content="..." Width="28" Height="26" VerticalAlignment="Center" Click="BtnImportExcel_Click" />
                </Grid>
            </StackPanel>
        </Border>

        <!-- 按钮区域 -->
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
            <Button Name="btnOK" Content="确定" HorizontalAlignment="Center" Margin="0 0 20 0"
                    VerticalAlignment="Center" Width="80" Height="26" Click="BtnOK_Click" />
            <Button Name="btnClose" Content="取消" HorizontalAlignment="Center" 
                    VerticalAlignment="Center" Width="80" Height="26" Click="BtnClose_Click" />
        </StackPanel>

    </Grid>
</Window>
