<!--
路径选择对话框

功能说明：
1. 从数据库加载所有路径
2. 支持多选
3. 显示路径基本信息（名称、类型、长度）
-->
<Window x:Class="NavisworksTransport.UI.WPF.Views.PathSelectionDialog"
        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" 
        mc:Ignorable="d" 
        Title="选择路径" 
        Height="500" 
        Width="800"
        WindowStartupLocation="CenterScreen"
        ResizeMode="CanResize"
        Topmost="True">
    
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/TransportPlugin;component/src/UI/WPF/Resources/NavisworksStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid Margin="20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- 搜索框 -->
        <Border Grid.Row="0" BorderBrush="#FFD4E7FF" BorderThickness="1" CornerRadius="0" Padding="12" Margin="0,0,0,10">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                
                <Label Grid.Column="0" Content="搜索:" VerticalAlignment="Center"/>
                <TextBox Grid.Column="1" Name="txtSearch" Margin="5,0,5,0" TextChanged="txtSearch_TextChanged"/>
                <Button Grid.Column="2" Content="全选" Name="btnSelectAll" Click="btnSelectAll_Click" 
                        Style="{StaticResource SecondaryButtonStyle}" Width="80" Margin="5,0,0,0"/>
            </Grid>
        </Border>

        <!-- 路径列表 -->
        <DataGrid Grid.Row="1" 
                  Name="dgPaths"
                  AutoGenerateColumns="False"
                  CanUserAddRows="False"
                  CanUserDeleteRows="False"
                  SelectionMode="Extended"
                  HeadersVisibility="Column"
                  GridLinesVisibility="Horizontal"
                  Margin="0,0,0,10">
            <DataGrid.Columns>
                <DataGridCheckBoxColumn Header="选择" Binding="{Binding IsSelected}" Width="50"/>
                <DataGridTextColumn Header="路径名称" Binding="{Binding Name}" Width="*"/>
                <DataGridTextColumn Header="类型" Binding="{Binding PathTypeDisplay}" Width="100"/>
                <DataGridTextColumn Header="长度" Binding="{Binding TotalLengthDisplay}" Width="100"/>
                <DataGridTextColumn Header="点数" Binding="{Binding PointCount}" Width="80"/>
                <DataGridTextColumn Header="创建时间" Binding="{Binding CreatedTimeDisplay}" Width="150"/>
            </DataGrid.Columns>
        </DataGrid>

        <!-- 底部按钮 -->
        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
            <TextBlock Name="txtSelectedCount" VerticalAlignment="Center" Margin="0,0,20,0" 
                       Text="已选择: 0 条路径"/>
            <Button Content="确定" Name="btnOK" Click="btnOK_Click" 
                    Style="{StaticResource ActionButtonStyle}" Width="100" Margin="0,0,10,0"/>
            <Button Content="取消" Name="btnCancel" Click="btnCancel_Click" 
                    Style="{StaticResource SecondaryButtonStyle}" Width="100"/>
        </StackPanel>
    </Grid>
</Window>
