<UserControl x:Class="FLY.Thick.FilmCasting.UI.UiModule.DynAreaFilmWidth"
             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" 
             xmlns:local="clr-namespace:FLY.Thick.FilmCasting.UI.UiModule"
             d:DesignWidth="250"
             mc:Ignorable="d" >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Converters.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <local:DynAreaUt x:Key="dynArea" Width="1231" FilmVelocityBeforeStretching="10.3" FilmVelocity="23.42" FilmPosition="2124.421"/>
            <local:InitparamUt x:Key="initparam" HasVBeforeStretching="True"/>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid d:DataContext="{StaticResource dynArea}">
        <Grid x:Name="grid_initparam" d:DataContext="{StaticResource initparam}"/>
        <Button Click="Border_Width_Click" Width="250" Style="{StaticResource Styles.Button.Empty}" >
            <Border Style="{StaticResource Styles.Module.Border}"  >
                <StackPanel Margin="2">
                    <Grid Margin="2">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Style="{StaticResource Styles.Module.Text.ItemHeader}" Text="宽度" />
                            <Viewbox Grid.Column="1" Height="24" HorizontalAlignment="Left" Margin="2,0">
                                <StackPanel Orientation="Horizontal" >
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue}" Text="{Binding Width, StringFormat={}{0:F0}}" />
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue.Unit}" Text="mm" />
                                </StackPanel>
                            </Viewbox>
                        </Grid>
                        <Grid Grid.Column="1" Visibility="{Binding ElementName=grid_initparam,Path=DataContext.HasVBeforeStretching,Converter={StaticResource visbilityconv}}" >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Style="{StaticResource Styles.Module.Text.ItemHeader}" Text="拉伸前速度" />
                            <Viewbox Grid.Column="1" Height="24" HorizontalAlignment="Left" Margin="2,0">
                                <StackPanel Orientation="Horizontal" >
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue}" Text="{Binding FilmVelocityBeforeStretching, StringFormat={}{0:F1}}" />
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue.Unit}" Text="m/min" />
                                </StackPanel>
                            </Viewbox>
                        </Grid>
                        <Grid Grid.Row="1" Grid.Column="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Style="{StaticResource Styles.Module.Text.ItemHeader}" Text="生产速度" />
                            <Viewbox Grid.Column="1" Height="24" HorizontalAlignment="Left" Margin="2,0">
                                <StackPanel Orientation="Horizontal" >
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue}" Text="{Binding FilmVelocity, StringFormat={}{0:F1}}" />
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue.Unit}" Text="m/min" />
                                </StackPanel>
                            </Viewbox>
                        </Grid>
                        <Grid Grid.Row="1" >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Style="{StaticResource Styles.Module.Text.ItemHeader}" Text="生产长度" />
                            <Viewbox Grid.Column="1" Height="24" HorizontalAlignment="Left" Margin="2,0">
                                <StackPanel Orientation="Horizontal" >
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue}" Text="{Binding FilmPosition, StringFormat={}{0:F2}}" />
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue.Unit}" Text="m"  />
                                </StackPanel>
                            </Viewbox>
                        </Grid>
                    </Grid>
                </StackPanel>
            </Border>
        </Button>
    </Grid>
</UserControl>