<UserControl x:Class="FLY.Thick.FilmCasting.UI.UiModule.DynAreaProfile"
             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"
             mc:Ignorable="d" d:DesignWidth="250">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.Thick.FilmCasting.UI;component/Themes/Styles.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Converter/Dictionary_MyConv.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <local:DynAreaProfileVmUt x:Key="viewModel"/>
        </ResourceDictionary>
    </UserControl.Resources>
    <StackPanel Width="250" d:DataContext="{StaticResource viewModel}">
        <Button x:Name="button_profile" Click="ButtonProfile_Click" Style="{StaticResource Styles.Button.Empty}" >
            <Border Style="{StaticResource Styles.Module.Border}" >
                <StackPanel Margin="2">
                    <Grid Margin="2">
                        <Rectangle Name="rectangle_profile" Fill="{StaticResource Brushes.Activity}" Height="48"/>
                        <StackPanel>
                            <Viewbox MaxWidth="{Binding ActualWidth, ElementName=rectangle_profile}" MaxHeight="24" >
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" >
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue}" Foreground="White"
                                               Text="{Binding PName}"/>
                                </StackPanel>
                            </Viewbox>
                            <Viewbox MaxWidth="{Binding ActualWidth, ElementName=rectangle_profile}" MaxHeight="18" >
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" >
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue}" Foreground="White">
                                        <Run Text="{Binding Batch}" /><Run Text="-"/><Run Text="{Binding Number}" />
                                    </TextBlock>
                                </StackPanel>
                            </Viewbox>
                        </StackPanel>
                        
                    </Grid>
                    <Grid Margin="2">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="182*" />
                            <ColumnDefinition Width="auto" />
                        </Grid.ColumnDefinitions>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource Styles.Module.Text.ItemHeader}" Text="目标值" />
                            <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue}" Text="{Binding Target, StringFormat={}{0:F2}}" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Grid.Column="1">
                            <TextBlock Style="{StaticResource Styles.Module.Text.ItemHeader}" Text="K" />
                            <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue}" Text="{Binding K, StringFormat={}{0:F3}}" />
                        </StackPanel>
                    </Grid>
                </StackPanel>
            </Border>
        </Button>
        <Button x:Name="button_bulkdb" Click="ButtonRollDown_Click" Style="{StaticResource Styles.Button.Empty}" >
            <Border >
                <StackPanel Margin="{StaticResource ControlMargin}" >
                    <TextBlock Foreground="White" HorizontalAlignment="Center">
                            <Run Text="{Binding StartTime,Mode=OneWay,StringFormat={}{0:MM-dd HH:mm}}"/>
                            <Run Text="~~~~~"/>
                            <Run Text="{Binding EndTime,Mode=OneWay,StringFormat={}{0:MM-dd HH:mm}}"/>
                    </TextBlock>

                    <TextBlock Text="下   辊" FontSize="24" Foreground="White" HorizontalAlignment="Center"/>
                </StackPanel>
                <Border.Style>
                    <Style BasedOn="{StaticResource Styles.Module.Border}" TargetType="Border">
                        <Setter Property="Background" Value="{StaticResource Brushes.Activity}"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsFinished}" Value="True">
                                <Setter Property="Background" Value="{StaticResource Brushes.NoAct}"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Border.Style>
            </Border>
        </Button>
    </StackPanel>

</UserControl>
