<flyctrllib:WindowBigClose x:Class="FLY.Weight.UI.Client.WdDensitySet"
        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:FLY.Weight.UI.Client"
        xmlns:control="clr-namespace:FLY.Weight.UI.Client.Control"
        xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
        mc:Ignorable="d"
        Title="Window_RatioSet" WindowStartupLocation="CenterScreen" SizeToContent="WidthAndHeight">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.Weight.UI.Client;component/Themes/UcWeighterItemStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <StackPanel Name="root_grid" Margin="5,20" >
        <StackPanel.DataContext>
            <StaticResource ResourceKey="unittests_weighters"/>
        </StackPanel.DataContext>
        <StackPanel Margin="{StaticResource ControlMargin}">
            <TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="密度设置" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" />
        </StackPanel>
        <Grid Margin="3" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Style="{StaticResource Styles.Text.FieldHeader.Editable}" Width="260" TextAlignment="Center" Text="密度" />
            <TextBlock Grid.Column="1" Style="{StaticResource Styles.Text.FieldHeader}" TextAlignment="Center" Text="厚度" />
        </Grid>
        <ItemsControl ItemsSource="{Binding Items}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Border Width="69" Height="60" Background="{Binding Color}" Margin="3">
                            <TextBlock Text="{Binding Number}" Width="60" Height="60" FontSize="60" Foreground="White" FontFamily="Arial Black" FontWeight="Bold"  VerticalAlignment="Bottom" HorizontalAlignment="Left" />
                        </Border>
                        <Border Grid.Column="1" Background="{Binding Color}" Margin="3" >
                            <StackPanel Orientation="Horizontal">
                                <Border BorderThickness="1" BorderBrush="White" Margin="3" >
                                    <StackPanel Orientation="Horizontal" Margin="20,3" HorizontalAlignment="Center" VerticalAlignment="Center">
                                        <Viewbox MaxWidth="100">
                                            <TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding Density, StringFormat={}{0:F3}}" Background="Transparent" Foreground="White"/>
                                        </Viewbox>
                                        <TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="kg/m³" Foreground="White" />
                                    </StackPanel>
                                </Border>
                                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="10">
                                    <TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="{Binding Thickness,StringFormat={}{0:F1}}" Foreground="White" Background="Transparent"/>
                                    <TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="um" Foreground="White" />
                                </StackPanel>
                            </StackPanel>

                        </Border>
                    </Grid>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </StackPanel>

</flyctrllib:WindowBigClose>