<UserControl x:Class="MECF.Framework.UI.Client.Ctrlib.UnitControls.CassetteTopView"
             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="80" d:DesignWidth="70">
    <Viewbox>
        <Viewbox.ContextMenu>
            <ContextMenu>
                <MenuItem Header="Create Cassette" Command="{Binding CreateCassetteCommand}" CommandParameter="{Binding PlacementTarget.Parent.CarrierModule, RelativeSource={RelativeSource FindAncestor,  AncestorType={x:Type ContextMenu}}}" />
                <MenuItem Header="Delete Cassette" Command="{Binding DeleteCassetteCommand}" CommandParameter="{Binding PlacementTarget.Parent.CarrierModule, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}}" />
            </ContextMenu>
        </Viewbox.ContextMenu>
        <Grid Background="Transparent">
            <Grid.Resources>
                <Style TargetType="Grid">
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Border.BorderBrush" Value="DarkGray"/>
                            <Setter Property="Background" Value="DarkGray"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="False">
                            <Setter Property="Border.BorderBrush" Value="Transparent"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Grid.Resources>
            <Image x:Name="VerticalImage">
                <Image.Resources>
                    <Style TargetType="Image" >
                        <Style.Triggers>
                            <DataTrigger  Binding="{Binding CarrierData.HasWaferIn, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" 
                                          Value="true">
                                <Setter Property="Source" Value="pack://application:,,,/MECF.Framework.UI.Client;component/Resources/Images/units/CassetteTopviewWithWafer.png" />
                            </DataTrigger>
                            <DataTrigger  Binding="{Binding CarrierData.HasWaferIn, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" 
                                          Value="false">
                                <Setter Property="Source" Value="pack://application:,,,/MECF.Framework.UI.Client;component/Resources/Images/units/CassetteTopViewNoWafer.png" />
                            </DataTrigger>

                            <DataTrigger  Binding="{Binding CarrierData.Status, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" 
                                          Value="Normal">
                                <Setter Property="Visibility" Value="Visible" />
                            </DataTrigger>

                            <DataTrigger  Binding="{Binding CarrierData.Status, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" 
                                          Value="Empty">
                                <Setter Property="Visibility" Value="Hidden" />
                            </DataTrigger>



                        </Style.Triggers>
                    </Style>
                </Image.Resources>
            </Image>
        </Grid>
    </Viewbox>


</UserControl>
