<Window x:Class="NavisworksTransport.UI.WPF.Views.EditCoordinatesWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:converters="clr-namespace:NavisworksTransport.UI.WPF.Converters"
        Title="编辑路径点坐标" Height="380" Width="400"
        WindowStartupLocation="CenterScreen"
        ResizeMode="NoResize"
        ShowInTaskbar="False"
        Topmost="True"
        Background="White">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/TransportPlugin;component/src/UI/WPF/Resources/NavisworksStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <converters:EditableNumberConverter x:Key="EditableNumberConverter"/>
        </ResourceDictionary>
    </Window.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <!-- 标题栏 -->
        <Border Grid.Row="0" Background="#FFF8FBFF" BorderBrush="#FFD4E7FF" BorderThickness="0,0,0,1" Padding="20,15">
            <StackPanel>
                <TextBlock Text="编辑路径点坐标" FontWeight="SemiBold" FontSize="14" Foreground="#FF2B579A"/>
                <TextBlock Text="修改路径点的三维坐标位置" FontSize="10" Foreground="#FF666666" Margin="0,3,0,0"/>
            </StackPanel>
        </Border>
        
        <!-- 输入区域 -->
        <Border Grid.Row="1" Padding="20,15">
            <StackPanel>
                <!-- 路径点信息 -->
                <Border Background="#FFF0F7FF" BorderBrush="#FFD4E7FF" BorderThickness="1" Padding="12,10" Margin="0,0,0,15">
                    <StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" Text="路径点:" FontSize="10" Foreground="#FF666666" VerticalAlignment="Center"/>
                            <TextBlock Grid.Column="1" Text="{Binding PointName}" FontSize="10" FontWeight="SemiBold" Foreground="#FF2B579A" VerticalAlignment="Center" Margin="5,0,0,0"/>
                        </Grid>
                        <Grid Margin="0,5,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" Text="类型:" FontSize="10" Foreground="#FF666666" VerticalAlignment="Center"/>
                            <TextBlock Grid.Column="1" Text="{Binding PointType}" FontSize="10" Foreground="#FF666666" VerticalAlignment="Center" Margin="5,0,0,0"/>
                        </Grid>
                    </StackPanel>
                </Border>
                
                <!-- X坐标 -->
                <Grid Margin="0,0,0,12">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="X 坐标:" VerticalAlignment="Center" FontSize="11" Foreground="#FF333333"/>
                    <TextBox Grid.Column="1" 
                             x:Name="XTextBox"
                             Text="{Binding X, Mode=TwoWay, UpdateSourceTrigger=LostFocus, Converter={StaticResource EditableNumberConverter}, ConverterParameter=0.000, ValidatesOnExceptions=True, NotifyOnValidationError=True}" 
                             Height="28"
                             VerticalContentAlignment="Center"
                             Padding="8,0"
                             FontSize="11"
                             BorderBrush="#FFCCCCCC"
                             BorderThickness="1"/>
                </Grid>
                
                <!-- Y坐标 -->
                <Grid Margin="0,0,0,12">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Y 坐标:" VerticalAlignment="Center" FontSize="11" Foreground="#FF333333"/>
                    <TextBox Grid.Column="1" 
                             x:Name="YTextBox"
                             Text="{Binding Y, Mode=TwoWay, UpdateSourceTrigger=LostFocus, Converter={StaticResource EditableNumberConverter}, ConverterParameter=0.000, ValidatesOnExceptions=True, NotifyOnValidationError=True}" 
                             Height="28"
                             VerticalContentAlignment="Center"
                             Padding="8,0"
                             FontSize="11"
                             BorderBrush="#FFCCCCCC"
                             BorderThickness="1"/>
                </Grid>
                
                <!-- Z坐标 -->
                <Grid Margin="0,0,0,12">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Z 坐标:" VerticalAlignment="Center" FontSize="11" Foreground="#FF333333"/>
                    <TextBox Grid.Column="1" 
                             x:Name="ZTextBox"
                             Text="{Binding Z, Mode=TwoWay, UpdateSourceTrigger=LostFocus, Converter={StaticResource EditableNumberConverter}, ConverterParameter=0.000, ValidatesOnExceptions=True, NotifyOnValidationError=True}" 
                             Height="28"
                             VerticalContentAlignment="Center"
                             Padding="8,0"
                             FontSize="11"
                             BorderBrush="#FFCCCCCC"
                             BorderThickness="1"/>
                </Grid>
            </StackPanel>
        </Border>
        
        <!-- 按钮栏 -->
        <Border Grid.Row="2" Background="#FFF8FBFF" BorderBrush="#FFD4E7FF" BorderThickness="0,1,0,0" Padding="20,12">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                <Button x:Name="CopyButton"
                        Click="OnCopyClick"
                        Style="{StaticResource IconButtonStyle}"
                        Width="32"
                        Height="32"
                        Margin="0,0,10,0"
                        ToolTip="复制坐标 (格式: X,Y,Z)">
                    <Path Data="{StaticResource CopyIconGeometry}"
                          Fill="{StaticResource NavisworksPrimaryBrush}"
                          Width="16" Height="16" Stretch="Uniform"/>
                </Button>
                <Button x:Name="PasteButton"
                        Click="OnPasteClick" 
                        Style="{StaticResource IconButtonStyle}" 
                        Width="32" 
                        Height="32"
                        Margin="0,0,10,0"
                        ToolTip="粘贴坐标 (格式: X,Y,Z)">
                    <Path Data="{StaticResource PasteIconGeometry}" 
                          Fill="{StaticResource NavisworksPrimaryBrush}" 
                          Width="16" Height="16" Stretch="Uniform"/>
                </Button>
                <Button Content="保存" 
                        Click="OnSaveClick" 
                        Style="{StaticResource ActionButtonStyle}" 
                        Width="90" 
                        Height="32"
                        Margin="0,0,10,0"/>
                <Button Content="取消" 
                        Click="OnCancelClick" 
                        Style="{StaticResource SecondaryButtonStyle}" 
                        Width="90"
                        Height="32"/>
            </StackPanel>
        </Border>
    </Grid>
</Window>

