<Window x:Class="NavisworksTransport.UI.WPF.Views.ModelItemBoundsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="元素包围盒信息" Height="640" Width="440"
        WindowStartupLocation="CenterScreen"
        ResizeMode="CanResize"
        ShowInTaskbar="True"
        Topmost="False"
        Background="White">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/TransportPlugin;component/src/UI/WPF/Resources/NavisworksStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </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,12">
            <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,12">
            <StackPanel>
                <!-- 元素名称 -->
                <Border Background="#FFF0F7FF" BorderBrush="#FFD4E7FF" BorderThickness="1" Padding="10,8" Margin="0,0,0,12">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="元素名称:" FontSize="10" Foreground="#FF666666" VerticalAlignment="Center"/>
                        <TextBox Grid.Column="1" Text="{Binding ElementName}" FontSize="10" FontWeight="SemiBold" Foreground="#FF2B579A" VerticalAlignment="Center" Margin="5,0,0,0" IsReadOnly="True" BorderThickness="0" Background="Transparent"/>
                    </Grid>
                </Border>
                
                <!-- 尺寸信息 -->
                <TextBlock Text="尺寸信息" FontWeight="SemiBold" FontSize="11" Foreground="#FF333333" Margin="0,0,0,6"/>
                <Grid Margin="0,0,0,12">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    
                    <!-- X尺寸 -->
                    <Grid Grid.Column="0" Margin="0,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="X:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding SizeX, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>
                    
                    <!-- Y尺寸 -->
                    <Grid Grid.Column="1" Margin="3,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Y:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding SizeY, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>
                    
                    <!-- Z尺寸 -->
                    <Grid Grid.Column="2" Margin="3,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Z:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding SizeZ, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>
                </Grid>
                
                <!-- 中心点坐标 -->
                <TextBlock Text="中心点坐标" FontWeight="SemiBold" FontSize="11" Foreground="#FF333333" Margin="0,0,0,6"/>
                <Grid Margin="0,0,0,12">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    
                    <!-- X -->
                    <Grid Grid.Column="0" Margin="0,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="X:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding CenterX, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>
                    
                    <!-- Y -->
                    <Grid Grid.Column="1" Margin="3,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Y:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding CenterY, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>
                    
                    <!-- Z -->
                    <Grid Grid.Column="2" Margin="3,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Z:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding CenterZ, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>
                    
                    <!-- 复制按钮 -->
                    <Button Grid.Column="3" 
                            x:Name="CopyCenterButton"
                            Style="{StaticResource IconButtonStyle}" 
                            Click="OnCopyCenterClick"
                            ToolTip="复制中心点坐标"
                            Margin="3,0,0,0">
                        <Path Data="{StaticResource CopyIconGeometry}" 
                              Fill="{StaticResource NavisworksPrimaryBrush}" 
                              Width="14" Height="14" Stretch="Uniform"/>
                    </Button>
                </Grid>
                
                <!-- 宿主包围盒顶面中心点 -->
                <TextBlock Text="宿主包围盒顶面中心点坐标" FontWeight="SemiBold" FontSize="11" Foreground="#FF333333" Margin="0,0,0,6"/>
                <Grid Margin="0,0,0,12">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    
                    <!-- X -->
                    <Grid Grid.Column="0" Margin="0,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="X:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding HostTopCenterX, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>
                    
                    <!-- Y -->
                    <Grid Grid.Column="1" Margin="3,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Y:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding HostTopCenterY, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>
                    
                    <!-- Z -->
                    <Grid Grid.Column="2" Margin="3,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Z:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding HostTopCenterZ, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>
                    
                    <!-- 复制按钮 -->
                    <Button Grid.Column="3" 
                            x:Name="CopyTopButton"
                            Style="{StaticResource IconButtonStyle}" 
                            Click="OnCopyTopCenterClick"
                            ToolTip="复制宿主包围盒顶面中心点坐标"
                            Margin="3,0,0,0">
                        <Path Data="{StaticResource CopyIconGeometry}" 
                              Fill="{StaticResource NavisworksPrimaryBrush}" 
                              Width="14" Height="14" Stretch="Uniform"/>
                    </Button>
                </Grid>
                
                <!-- 宿主包围盒底面中心点 -->
                <TextBlock Text="宿主包围盒底面中心点坐标" FontWeight="SemiBold" FontSize="11" Foreground="#FF333333" Margin="0,0,0,6"/>
                <Grid Margin="0,0,0,12">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    
                    <!-- X -->
                    <Grid Grid.Column="0" Margin="0,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="X:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding HostBottomCenterX, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>
                    
                    <!-- Y -->
                    <Grid Grid.Column="1" Margin="3,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Y:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding HostBottomCenterY, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>
                    
                    <!-- Z -->
                    <Grid Grid.Column="2" Margin="3,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Z:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding HostBottomCenterZ, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>
                    
                    <!-- 复制按钮 -->
                    <Button Grid.Column="3" 
                            x:Name="CopyBottomButton"
                            Style="{StaticResource IconButtonStyle}" 
                            Click="OnCopyBottomCenterClick"
                            ToolTip="复制宿主包围盒底面中心点坐标"
                            Margin="3,0,0,0">
                        <Path Data="{StaticResource CopyIconGeometry}" 
                              Fill="{StaticResource NavisworksPrimaryBrush}" 
                              Width="14" Height="14" Stretch="Uniform"/>
                    </Button>
                </Grid>

                <!-- 对象姿态语义顶面中心点 -->
                <TextBlock Text="对象姿态语义顶面中心点坐标" FontWeight="SemiBold" FontSize="11" Foreground="#FF333333" Margin="0,0,0,6"/>
                <Grid Margin="0,0,0,12">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>

                    <Grid Grid.Column="0" Margin="0,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="X:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding OrientedTopCenterX, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>

                    <Grid Grid.Column="1" Margin="3,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Y:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding OrientedTopCenterY, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>

                    <Grid Grid.Column="2" Margin="3,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Z:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding OrientedTopCenterZ, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>

                    <Button Grid.Column="3"
                            x:Name="CopyOrientedTopButton"
                            Style="{StaticResource IconButtonStyle}"
                            Click="OnCopyOrientedTopCenterClick"
                            ToolTip="复制对象姿态语义顶面中心点坐标"
                            Margin="3,0,0,0">
                        <Path Data="{StaticResource CopyIconGeometry}"
                              Fill="{StaticResource NavisworksPrimaryBrush}"
                              Width="14" Height="14" Stretch="Uniform"/>
                    </Button>
                </Grid>

                <!-- 对象姿态语义底面中心点 -->
                <TextBlock Text="对象姿态语义底面中心点坐标" FontWeight="SemiBold" FontSize="11" Foreground="#FF333333" Margin="0,0,0,6"/>
                <Grid Margin="0,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>

                    <Grid Grid.Column="0" Margin="0,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="X:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding OrientedBottomCenterX, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>

                    <Grid Grid.Column="1" Margin="3,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Y:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding OrientedBottomCenterY, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>

                    <Grid Grid.Column="2" Margin="3,0,3,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Z:" FontSize="11" Foreground="#FF666666" VerticalAlignment="Center" Margin="0,0,3,0"/>
                        <TextBox Grid.Column="1" Text="{Binding OrientedBottomCenterZ, StringFormat=0.000}" FontSize="11" IsReadOnly="True" Padding="4,2"/>
                    </Grid>

                    <Button Grid.Column="3"
                            x:Name="CopyOrientedBottomButton"
                            Style="{StaticResource IconButtonStyle}"
                            Click="OnCopyOrientedBottomCenterClick"
                            ToolTip="复制对象姿态语义底面中心点坐标"
                            Margin="3,0,0,0">
                        <Path Data="{StaticResource CopyIconGeometry}"
                              Fill="{StaticResource NavisworksPrimaryBrush}"
                              Width="14" Height="14" Stretch="Uniform"/>
                    </Button>
                </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 Content="刷新" 
                        Click="OnRefreshClick" 
                        Style="{StaticResource ActionButtonStyle}" 
                        Width="90" 
                        Height="32"
                        Margin="0,0,10,0"
                        ToolTip="刷新选中元素的包围盒信息"/>
                <Button Content="关闭" 
                        Click="OnCloseClick" 
                        Style="{StaticResource SecondaryButtonStyle}" 
                        Width="90"
                        Height="32"/>
            </StackPanel>
        </Border>
    </Grid>
</Window>

