<UserControl x:Class="MECF.Framework.Simulator.Core.Robots.BrooksMag7RobotTesterView"
             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:MECF.Framework.Simulator.Core.Robots"
             xmlns:deviceControl="clr-namespace:MECF.Framework.UI.Core.DeviceControl;assembly=MECF.Framework.UI.Core"
             Height="920"  Width="1920">
    <StackPanel>
        <Label Content="{Binding Title}" FontSize="20" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Background="LightBlue" Height="50"></Label>
        <Grid>
 
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1000"></ColumnDefinition>
            <ColumnDefinition Width="300"></ColumnDefinition>
        </Grid.ColumnDefinitions>

        <StackPanel Orientation="Vertical" Grid.Column="0" Height="900">

            <Button Content="Clear Log" Width="100" Height="35" HorizontalAlignment="Left" Command="{Binding ClearLogCommand}"></Button>
            
            <DataGrid Height="823" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserSortColumns="False" ItemsSource="{Binding TransactionLogItems}"  >
                <DataGrid.Columns>

                    <DataGridTextColumn Header="Time" Width="90" IsReadOnly="True" Binding="{Binding OccurTime, UpdateSourceTrigger=PropertyChanged}"/>

                    <DataGridTextColumn Header="Incoming" Width="180" IsReadOnly="True"  Binding="{Binding Incoming, UpdateSourceTrigger=PropertyChanged}">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="TextBlock">
                                <Setter Property="TextWrapping" Value="Wrap"/>
                                <Setter Property="Height" Value="auto"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>


                    <DataGridTextColumn Header="Outgoing" Width="180" IsReadOnly="True"  Binding="{Binding Outgoing, UpdateSourceTrigger=PropertyChanged}">
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="TextBlock">
                                <Setter Property="TextWrapping" Value="Wrap"/>
                                <Setter Property="Height" Value="auto"/>
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>

                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>

        <Grid  Grid.Column="1" Height="900">
            <Grid.RowDefinitions>
                <RowDefinition Height="50"></RowDefinition>
                <RowDefinition Height="300"></RowDefinition>
                <RowDefinition Height="550"></RowDefinition>
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Orientation="Horizontal" >
                <Button Width="100" Height="35" Content="Enable" Command="{Binding EnableCommand}" IsEnabled="{Binding IsEnableEnable}"></Button>
                <Button Width="100" Height="35" Content="Disable" Command="{Binding DisableCommand}" IsEnabled="{Binding IsEnableDisable}"></Button>
            </StackPanel>

            <Canvas Grid.Row="1" Height="300">
                <deviceControl:ModuleControl Width="80" Height="60" ModuleName="PM1" HasWafer="False" Canvas.Top="89"></deviceControl:ModuleControl>

                <deviceControl:ModuleControl Width="80" Height="60" ModuleName="PM2" HasWafer="False" Canvas.Left="61" Canvas.Top="24"></deviceControl:ModuleControl>
                <deviceControl:ModuleControl Width="80" Height="60" ModuleName="PM3" HasWafer="False" Canvas.Left="165" Canvas.Top="24"></deviceControl:ModuleControl>
                <deviceControl:ModuleControl Width="80" Height="60" ModuleName="PM4" HasWafer="False" Canvas.Left="198" Canvas.Top="89"></deviceControl:ModuleControl>

                <deviceControl:ModuleControl Width="102" Height="112" ModuleName="TM" HasWafer="False" Canvas.Left="96" Canvas.Top="89"></deviceControl:ModuleControl>

                <deviceControl:ModuleControl Width="59" Height="44" ModuleName="LL1" HasWafer="False" Canvas.Left="70" Canvas.Top="226"></deviceControl:ModuleControl>
                <deviceControl:ModuleControl Width="55" Height="45" ModuleName="LL2" HasWafer="False" Canvas.Left="165" Canvas.Top="226" RenderTransformOrigin="0.649,0.618"></deviceControl:ModuleControl>
                <deviceControl:ModuleControl Width="59" Height="39" ModuleName="Aligner1" HasWafer="False" Canvas.Left="21" Canvas.Top="182"></deviceControl:ModuleControl>
                <deviceControl:ModuleControl Width="57" Height="39" ModuleName="Aligner2" HasWafer="False" Canvas.Left="212" Canvas.Top="178"></deviceControl:ModuleControl>
            </Canvas>

            <Grid Grid.Row="2" >
                    <StackPanel >
                        <Button Width="100" Height="35" Content="Home" Command="{Binding HomeCommand}" IsEnabled="{Binding IsEnableDisable}"></Button>
                        <Button Width="100" Height="35" Content="Pick" Command="{Binding PickCommand}" IsEnabled="{Binding IsEnableDisable}"></Button>
                        <Button Width="100" Height="35" Content="Place" Command="{Binding PlaceCommand}" IsEnabled="{Binding IsEnableDisable}"></Button>
                    </StackPanel>
                </Grid>
        </Grid>

        

    </Grid>
        </StackPanel>
</UserControl>
