<Page x:Class="ThickTcpUiInWindow.Page_CoatingSegmentProfile"
      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" 
      d:DesignHeight="768" d:DesignWidth="1024"
      Loaded="Page_Loaded" Unloaded="Page_Unloaded"
	Title="Page_CoatingSegmentProfile">
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/ThickTcpUiInWindow;component/Converter/Dictionary_MyConv.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Page.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="496*" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <Grid Background="{StaticResource Background_Title}">
            <StackPanel Orientation="Horizontal" Background="{StaticResource Background_Title}">
                <Button Style="{StaticResource ButtonStyle_back2}" Command="BrowseBack" />
                <TextBlock Margin="160,0,0,0" FontWeight="Bold" FontFamily="YouYuan" TextAlignment="Left" VerticalAlignment="Center">
                <Run Foreground="White" FontSize="60"  Text="段长信息|"/>
                <Run Foreground="Black" FontSize="30" Text="{Binding ProductName}" FontFamily="Microsoft Sans Serif" />
                </TextBlock>
            </StackPanel>
        </Grid>
        <ListView Name="listview_parts" Grid.Row="1" ItemsSource="{Binding CoatingPartList}">
            <ListView.View>
                <GridView>
                    <GridViewColumn >
                        <GridViewColumn.Header>
                            <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="总长" />
                        </GridViewColumn.Header>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate >
                                <StackPanel Orientation="Horizontal" Margin="5,0"  Background="Black">
                                    <TextBox Style="{StaticResource TextBoxStyle1}" FontSize="24" FontFamily="Microsoft Sans Serif" TextAlignment="Center" HorizontalAlignment="Center" Background="Black" Foreground="White" Margin="5,0" Text="{Binding Total}" />
                                </StackPanel>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn >
                        <GridViewColumn.Header>
                            <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="留白" />
                        </GridViewColumn.Header>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate >
                                <StackPanel Orientation="Horizontal" Margin="5,0"  Background="#FFE8E8E8">
                                    <TextBox Style="{StaticResource TextBoxStyle1}" Text="{Binding Distance}" FontSize="24" FontFamily="Microsoft Sans Serif" TextAlignment="Center" HorizontalAlignment="Center" Foreground="Black" Background="#FFE8E8E8" Margin="5,0"/>
                                </StackPanel>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
        <StackPanel Orientation="Horizontal"  Grid.Row="2" FlowDirection="RightToLeft" Margin="0,10,-6,10">
            <Button Content="删除" Style="{StaticResource ResourceKey=ButtonStyle2}" Click="button_del_Click" />
            <Button Content="添加" Style="{StaticResource ResourceKey=ButtonStyle2}" Click="button_add_Click" />
            <Button Content="应用" Style="{StaticResource ResourceKey=ButtonStyle2}" Click="button_apply_Click" />
        </StackPanel>
    </Grid>
</Page>

