<UserControl
    x:Class="SicUI.Controls.WaferAssociationUnitLite"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="http://OpenSEMI.Ctrlib.com/presentation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:lex="http://wpflocalizeextension.codeplex.com"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:micro="clr-namespace:Caliburn.Micro;assembly=MECF.Framework.UI.Client"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    lex:LocalizeDictionary.DesignCulture="zh"
    lex:ResxLocalizationProvider.DefaultAssembly="Sicentury.Localization"
    lex:ResxLocalizationProvider.DefaultDictionary="lang_overview">
    <UserControl.Resources>
        <Style TargetType="ToolTip">
            <Style.Triggers>
                <Trigger Property="Content" Value="{x:Static sys:String.Empty}">
                    <Setter Property="Visibility" Value="Collapsed" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <Grid Width="300" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="2*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <Border
            Grid.Row="0"
            Grid.Column="0"
            Width="90"
            Padding="5,1"
            Background="{DynamicResource Table_BG_Title}"
            BorderBrush="{DynamicResource Table_BD}"
            BorderThickness="1">
            <TextBlock
                VerticalAlignment="Center"
                FontFamily="Arial"
                FontSize="12"
                Foreground="{DynamicResource FG_Black}"
                Text="{lex:Loc ID_TXT_JobAssign_LotID}"
                TextWrapping="Wrap" />
        </Border>
        <Border
            Grid.Row="0"
            Grid.Column="1"
            Width="235"
            Padding="5,1"
            Background="{DynamicResource Table_BG_Content}"
            BorderBrush="{DynamicResource Table_BD}"
            BorderThickness="0,1,1,1">
            <StackPanel Orientation="Horizontal">
                <controls:TextBoxEx
                    Width="225"
                    Text="{Binding WAInfo.LotId, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
                    TextSaved="{Binding WAInfo.LotIdSaved, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Mode=TwoWay}" />

            </StackPanel>
        </Border>
        <Button
            Grid.RowSpan="2"
            Grid.Column="2"
            Width="auto"
            Height="auto"
            Margin="3"
            Content="{lex:Loc ID_BTN_JobAssign_Start_Content}">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Click">
                    <micro:ActionMessage MethodName="Start">
                        <micro:Parameter Value="{Binding WAInfo.JobID, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
                    </micro:ActionMessage>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Button>

        <Border
            Grid.Row="1"
            Grid.Column="0"
            Width="90"
            Padding="5,1"
            Background="{DynamicResource Table_BG_Title}"
            BorderBrush="{DynamicResource Table_BD}"
            BorderThickness="1,0,1,1">
            <TextBlock
                VerticalAlignment="Center"
                FontFamily="Arial"
                FontSize="12"
                Foreground="{DynamicResource FG_Black}"
                Text="{lex:Loc ID_TXT_JobAssign_Sequence}"
                TextWrapping="Wrap" />
        </Border>
        <Border
            Grid.Row="1"
            Grid.Column="1"
            Width="auto"
            Padding="5,1"
            Background="{DynamicResource Table_BG_Content}"
            BorderBrush="{DynamicResource Table_BD}"
            BorderThickness="0,0,1,1">
            <StackPanel Orientation="Horizontal">
                <TextBox
                    Width="75"
                    IsReadOnly="True"
                    Text="{Binding WAInfo.SequenceName, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
                <Button
                    Width="60"
                    Margin="4,0,0,0"
                    Padding="0"
                    Content="{lex:Loc ID_BTN_JobAssign_SelectSequence_Content}"
                    IsEnabled="{Binding WAInfo.IsEnableSelect, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <micro:ActionMessage MethodName="SelectSequence">
                                <micro:Parameter Value="{Binding WAInfo, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
                            </micro:ActionMessage>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </Button>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>
