<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:cvt="clr-namespace:OpenSEMI.Ctrlib.Converter"
    xmlns:lex="http://wpflocalizeextension.codeplex.com"
    xmlns:local="clr-namespace:OpenSEMI.Ctrlib.Controls"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:wnd="clr-namespace:OpenSEMI.Ctrlib.Window">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/MECF.Framework.UI.Client;component/DataGridTransform/DataGrid/Themes/Generic.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <LinearGradientBrush x:Key="GrayBlueGradientBrush" StartPoint="0,0" EndPoint="1,1">
        <GradientStop Offset="0" Color="DarkGray" />
        <GradientStop Offset="0.5" Color="#CCCCFF" />
        <GradientStop Offset="1" Color="DarkGray" />
    </LinearGradientBrush>

    <Style x:Key="PoppingExpanderSholdDelete" TargetType="{x:Type Button}">
        <Setter Property="Background" Value="{StaticResource GrayBlueGradientBrush}" />
        <Setter Property="Width" Value="80" />
        <Setter Property="Margin" Value="10" />
    </Style>

    <cvt:SlotBorderConverter x:Key="borderConverter" />

    <Style TargetType="{x:Type local:Valve}">
        <Setter Property="ValveState" Value="UNKNOWN" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Orientation" Value="Horizontal" />
        <Setter Property="Height" Value="16" />
        <Setter Property="Width" Value="16" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Valve}">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Cursor="Hand"
                        SnapsToDevicePixels="True">

                        <Grid>
                            <Ellipse HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                <Ellipse.Fill>
                                    <LinearGradientBrush StartPoint="0.854,0.854" EndPoint="0.146,0.146">
                                        <GradientStop Offset="0" Color="#FF333333" />
                                        <GradientStop Offset="1" Color="#FFCECECE" />
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>

                            <Ellipse
                                Margin="1"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch">
                                <Ellipse.Fill>
                                    <LinearGradientBrush StartPoint="0.146,0.146" EndPoint="0.854,0.854">
                                        <GradientStop Offset="0" Color="#FF333333" />
                                        <GradientStop Offset="1" Color="#FFCECECE" />
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>

                            <Rectangle
                                x:Name="PART_OPEN"
                                Height="4"
                                Margin="2,0"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Center"
                                Fill="#FF00BA28"
                                RadiusX="1"
                                RadiusY="1"
                                RenderTransformOrigin="0.5,0.5"
                                Stroke="#FF104F1D"
                                Visibility="Collapsed" />

                            <Rectangle
                                x:Name="PART_CLOSE"
                                Width="4"
                                Margin="0,2"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Stretch"
                                Fill="#FF3B3B3B"
                                RadiusX="1"
                                RadiusY="1"
                                RenderTransformOrigin="0.5,0.5"
                                Stroke="#FF1F1F1F"
                                Visibility="Collapsed" />

                            <Path
                                x:Name="PART_UNKNOWN"
                                Margin="2"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Data="M5.5,0.5 L6.5,0.5 C7.0522847,0.5 7.5,0.94771528 7.5,1.5 L7.5,4.4999999 10.5,4.4999999 C11.052285,4.5 11.5,4.9477152 11.5,5.5 L11.5,6.5 C11.5,7.0522847 11.052285,7.5 10.5,7.5 L7.5,7.5 7.5,10.5 C7.5,11.052285 7.0522847,11.5 6.5,11.5 L5.5,11.5 C4.9477153,11.5 4.5,11.052285 4.5,10.5 L4.5,7.5 1.5,7.5 C0.94771522,7.5 0.5,7.0522847 0.5,6.5 L0.5,5.5 C0.5,4.9477152 0.94771522,4.5 1.5,4.4999999 L4.5,4.4999999 4.5,1.5 C4.5,0.94771528 4.9477153,0.5 5.5,0.5 z"
                                Fill="#FFAFAFAF"
                                RenderTransformOrigin="0.5,0.5"
                                Stretch="Fill"
                                Stroke="#FF505050"
                                Visibility="Visible">
                                <Path.RenderTransform>
                                    <RotateTransform Angle="45" />
                                </Path.RenderTransform>
                            </Path>
                        </Grid>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="ValveState" Value="ON">
                            <Setter TargetName="PART_OPEN" Property="Visibility" Value="Visible" />
                            <Setter TargetName="PART_CLOSE" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="PART_UNKNOWN" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="ValveState" Value="OFF">
                            <Setter TargetName="PART_OPEN" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="PART_CLOSE" Property="Visibility" Value="Visible" />
                            <Setter TargetName="PART_UNKNOWN" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:Valve}">
                            <Border
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Cursor="Hand"
                                SnapsToDevicePixels="True">

                                <Grid>
                                    <Ellipse HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                        <Ellipse.Fill>
                                            <LinearGradientBrush StartPoint="0.854,0.854" EndPoint="0.146,0.146">
                                                <GradientStop Offset="0" Color="#FF333333" />
                                                <GradientStop Offset="1" Color="#FFCECECE" />
                                            </LinearGradientBrush>
                                        </Ellipse.Fill>
                                    </Ellipse>

                                    <Ellipse
                                        Margin="1"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch">
                                        <Ellipse.Fill>
                                            <LinearGradientBrush StartPoint="0.146,0.146" EndPoint="0.854,0.854">
                                                <GradientStop Offset="0" Color="#FF333333" />
                                                <GradientStop Offset="1" Color="#FFCECECE" />
                                            </LinearGradientBrush>
                                        </Ellipse.Fill>
                                    </Ellipse>

                                    <Rectangle
                                        x:Name="PART_OPEN"
                                        Width="4"
                                        Margin="0,2"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Stretch"
                                        Fill="#FF00BA28"
                                        RadiusX="1"
                                        RadiusY="1"
                                        RenderTransformOrigin="0.5,0.5"
                                        Stroke="#FF104F1D"
                                        Visibility="Collapsed" />

                                    <Rectangle
                                        x:Name="PART_CLOSE"
                                        Height="4"
                                        Margin="2,0"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Center"
                                        Fill="#FF3B3B3B"
                                        RadiusX="1"
                                        RadiusY="1"
                                        RenderTransformOrigin="0.5,0.5"
                                        Stroke="#FF1F1F1F"
                                        Visibility="Collapsed" />

                                    <Path
                                        x:Name="PART_UNKNOWN"
                                        Margin="2"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Data="M5.5,0.5 L6.5,0.5 C7.0522847,0.5 7.5,0.94771528 7.5,1.5 L7.5,4.4999999 10.5,4.4999999 C11.052285,4.5 11.5,4.9477152 11.5,5.5 L11.5,6.5 C11.5,7.0522847 11.052285,7.5 10.5,7.5 L7.5,7.5 7.5,10.5 C7.5,11.052285 7.0522847,11.5 6.5,11.5 L5.5,11.5 C4.9477153,11.5 4.5,11.052285 4.5,10.5 L4.5,7.5 1.5,7.5 C0.94771522,7.5 0.5,7.0522847 0.5,6.5 L0.5,5.5 C0.5,4.9477152 0.94771522,4.5 1.5,4.4999999 L4.5,4.4999999 4.5,1.5 C4.5,0.94771528 4.9477153,0.5 5.5,0.5 z"
                                        Fill="#FFAFAFAF"
                                        RenderTransformOrigin="0.5,0.5"
                                        Stretch="Fill"
                                        Stroke="#FF505050"
                                        Visibility="Visible">
                                        <Path.RenderTransform>
                                            <RotateTransform Angle="45" />
                                        </Path.RenderTransform>
                                    </Path>
                                </Grid>
                            </Border>

                            <ControlTemplate.Triggers>
                                <Trigger Property="ValveState" Value="ON">
                                    <Setter TargetName="PART_OPEN" Property="Visibility" Value="Visible" />
                                    <Setter TargetName="PART_CLOSE" Property="Visibility" Value="Collapsed" />
                                    <Setter TargetName="PART_UNKNOWN" Property="Visibility" Value="Collapsed" />
                                </Trigger>
                                <Trigger Property="ValveState" Value="OFF">
                                    <Setter TargetName="PART_OPEN" Property="Visibility" Value="Collapsed" />
                                    <Setter TargetName="PART_CLOSE" Property="Visibility" Value="Visible" />
                                    <Setter TargetName="PART_UNKNOWN" Property="Visibility" Value="Collapsed" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type local:TextBoxEx}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="FontFamily" Value="Arial" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="BorderThickness" Value="1,1,0,0" />
        <Setter Property="MinHeight" Value="20" />
        <Setter Property="Background" Value="White" />
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="BorderBrush" Value="#FF1B1B1B" />
        <Setter Property="Padding" Value="5,1" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="AllowDrop" Value="true" />
        <Setter Property="ChangedColor" Value="#FFC0F18D" />
        <Setter Property="WarningColor" Value="#FFFFE63D" />
        <Setter Property="NormalColor" Value="White" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:TextBoxEx}">
                    <Grid>
                        <Border
                            x:Name="TextBox_Outer"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                            <Border
                                x:Name="TextBox_Inner"
                                Padding="{TemplateBinding Padding}"
                                BorderBrush="#FFD6D6D6"
                                BorderThickness="0,0,1,1" />
                        </Border>
                        <Rectangle
                            x:Name="Lfet_Boder"
                            Width="1"
                            Margin="1"
                            HorizontalAlignment="Left"
                            Fill="{DynamicResource TextBox_InnerLeft}" />
                        <Rectangle
                            x:Name="Top_Boder"
                            Height="1"
                            Margin="1"
                            VerticalAlignment="Top"
                            Fill="{DynamicResource TextBox_InnerTop}" />
                        <Rectangle
                            x:Name="Right_Boder"
                            Width="1"
                            Margin="1,2,1,1"
                            HorizontalAlignment="Right"
                            Fill="{DynamicResource TextBox_InnerRight}" />
                        <Rectangle
                            x:Name="Bottom_Boder"
                            Height="1"
                            Margin="1,1,2,1"
                            VerticalAlignment="Bottom"
                            Fill="{DynamicResource TextBox_InnerBottom}" />
                        <ScrollViewer
                            x:Name="PART_ContentHost"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="TextBox_Outer" Property="BorderBrush" Value="#FF747474" />
                            <Setter TargetName="TextBox_Outer" Property="Background" Value="Gainsboro" />
                            <Setter TargetName="TextBox_Inner" Property="BorderBrush" Value="#FFBEBDBD" />
                            <Setter TargetName="Lfet_Boder" Property="Fill" Value="{DynamicResource TextBox_InnerLeft_Unable}" />
                            <Setter TargetName="Top_Boder" Property="Fill" Value="{DynamicResource TextBox_InnerTop_Unable}" />
                            <Setter TargetName="Right_Boder" Property="Fill" Value="{DynamicResource TextBox_InnerRight_Unable}" />
                            <Setter TargetName="Bottom_Boder" Property="Fill" Value="{DynamicResource TextBox_InnerBottom_Unable}" />
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
                        </Trigger>
                        <Trigger Property="Text" Value="{x:Static sys:String.Empty}">
                            <Setter Property="ToolTipService.IsEnabled" Value="False" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="GenericTextBoxStyle" TargetType="{x:Type TextBox}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="FontFamily" Value="Arial" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="BorderThickness" Value="1,1,0,0" />
        <Setter Property="MinHeight" Value="20" />
        <Setter Property="Background" Value="White" />
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="BorderBrush" Value="#FF1B1B1B" />
        <Setter Property="Padding" Value="5,1" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="AllowDrop" Value="true" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Grid>
                        <Border
                            x:Name="TextBox_Outer"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                            <Border
                                x:Name="TextBox_Inner"
                                Padding="{TemplateBinding Padding}"
                                BorderBrush="#FFD6D6D6"
                                BorderThickness="0,0,1,1" />
                        </Border>
                        <Rectangle
                            x:Name="Lfet_Boder"
                            Width="1"
                            Margin="1"
                            HorizontalAlignment="Left"
                            Fill="{DynamicResource TextBox_InnerLeft}" />
                        <Rectangle
                            x:Name="Top_Boder"
                            Height="1"
                            Margin="1"
                            VerticalAlignment="Top"
                            Fill="{DynamicResource TextBox_InnerTop}" />
                        <Rectangle
                            x:Name="Right_Boder"
                            Width="1"
                            Margin="1,2,1,1"
                            HorizontalAlignment="Right"
                            Fill="{DynamicResource TextBox_InnerRight}" />
                        <Rectangle
                            x:Name="Bottom_Boder"
                            Height="1"
                            Margin="1,1,2,1"
                            VerticalAlignment="Bottom"
                            Fill="{DynamicResource TextBox_InnerBottom}" />
                        <ScrollViewer
                            x:Name="PART_ContentHost"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="TextBox_Outer" Property="BorderBrush" Value="#FF747474" />
                            <Setter TargetName="TextBox_Outer" Property="Background" Value="Gainsboro" />
                            <Setter TargetName="TextBox_Inner" Property="BorderBrush" Value="#FFBEBDBD" />
                            <Setter TargetName="Lfet_Boder" Property="Fill" Value="{DynamicResource TextBox_InnerLeft_Unable}" />
                            <Setter TargetName="Top_Boder" Property="Fill" Value="{DynamicResource TextBox_InnerTop_Unable}" />
                            <Setter TargetName="Right_Boder" Property="Fill" Value="{DynamicResource TextBox_InnerRight_Unable}" />
                            <Setter TargetName="Bottom_Boder" Property="Fill" Value="{DynamicResource TextBox_InnerBottom_Unable}" />
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
                        </Trigger>
                        <Trigger Property="Text" Value="{x:Static sys:String.Empty}">
                            <Setter Property="ToolTipService.IsEnabled" Value="False" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type local:Wafer}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Wafer}">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                        <Border.ToolTip>
                            <ToolTip Name="tb_tooltip">
                                <StackPanel Orientation="Vertical">
                                    <TextBlock Text="{Binding WaferTooltip, RelativeSource={RelativeSource TemplatedParent}}" />
                                </StackPanel>
                            </ToolTip>
                        </Border.ToolTip>
                        <Grid>
                            <Rectangle
                                x:Name="WaferCtrl_FrontView"
                                Width="90"
                                Height="11"
                                Stroke="#FF232200">
                                <Rectangle.Fill>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="#FFB88700" />
                                        <GradientStop Offset="1" Color="#FFB88700" />
                                        <GradientStop Offset="0.5" Color="#FFF7E0A0" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Grid
                                x:Name="WaferCtrl_TopView"
                                Width="65"
                                Height="65"
                                Visibility="Collapsed">
                                <Ellipse
                                    x:Name="SSC_WaferBG"
                                    Fill="#FFFFBB00"
                                    Stroke="#FF232200" />
                                <Ellipse
                                    x:Name="SSC_Wafer1"
                                    Margin="1"
                                    RenderTransformOrigin="0.5,0.5">
                                    <Ellipse.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform />
                                            <SkewTransform />
                                            <RotateTransform Angle="75" />
                                            <TranslateTransform />
                                        </TransformGroup>
                                    </Ellipse.RenderTransform>
                                    <Ellipse.Fill>
                                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                            <GradientStop Offset="0" Color="#00E6E4AD" />
                                            <GradientStop Offset="1" Color="#00E6E4AD" />
                                            <GradientStop Offset="0.45" Color="White" />
                                            <GradientStop Offset="0.55" Color="White" />
                                        </LinearGradientBrush>
                                    </Ellipse.Fill>
                                </Ellipse>
                                <Ellipse
                                    x:Name="SSC_Wafer2"
                                    Margin="1"
                                    Opacity="0.75"
                                    RenderTransformOrigin="0.5,0.5">
                                    <Ellipse.Fill>
                                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                            <GradientStop Offset="0" Color="#00E6E4AD" />
                                            <GradientStop Offset="1" Color="#00E6E4AD" />
                                            <GradientStop Offset="0.5" Color="#FFAF8100" />
                                        </LinearGradientBrush>
                                    </Ellipse.Fill>
                                </Ellipse>
                            </Grid>

                            <TextBlock
                                x:Name="Border_Txt"
                                MaxWidth="60"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontFamily="Arial"
                                FontSize="10"
                                Foreground="{DynamicResource FG_Black}"
                                Text="{Binding Path=SourceName, RelativeSource={RelativeSource TemplatedParent}}"
                                TextTrimming="CharacterEllipsis"
                                TextWrapping="WrapWithOverflow" />
                            <TextBlock
                                x:Name="Border_question"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontFamily="Arial"
                                FontSize="14"
                                FontWeight="Bold"
                                Foreground="Red"
                                Text="?"
                                TextWrapping="NoWrap"
                                Visibility="{Binding Path=DuplicatedVisibility, RelativeSource={RelativeSource TemplatedParent}}">
                                <TextBlock.Effect>
                                    <DropShadowEffect
                                        BlurRadius="6"
                                        ShadowDepth="0"
                                        Color="White" />
                                </TextBlock.Effect>
                            </TextBlock>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="SourceName" Value="{x:Static sys:String.Empty}">
                            <Setter TargetName="Border_Txt" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="WaferTooltip" Value="{x:Static sys:String.Empty}">
                            <Setter TargetName="tb_tooltip" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="ViewType" Value="Front">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Visibility" Value="Visible" />
                            <Setter TargetName="WaferCtrl_TopView" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="ViewType" Value="Top">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="WaferCtrl_TopView" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="WaferStatus" Value="0">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Stroke" Value="#002F4E48" />
                            <Setter TargetName="WaferCtrl_FrontView" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="#00B88700" />
                                        <GradientStop Offset="1" Color="#00B88700" />
                                        <GradientStop Offset="0.5" Color="#00F7E0A0" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_WaferBG" Property="Stroke" Value="#002F4E48" />
                            <Setter TargetName="SSC_WaferBG" Property="Fill" Value="#00FFBB00" />
                            <Setter TargetName="SSC_Wafer1" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00E6E4AD" />
                                        <GradientStop Offset="1" Color="#00E6E4AD" />
                                        <GradientStop Offset="0.45" Color="#00E6E4AD" />
                                        <GradientStop Offset="0.55" Color="#00E6E4AD" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_Wafer2" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00E6E4AD" />
                                        <GradientStop Offset="1" Color="#00E6E4AD" />
                                        <GradientStop Offset="0.5" Color="#00AF8100" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="tb_tooltip" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Border_Txt" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="WaferStatus" Value="1">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Stroke" Value="#FF232200" />
                            <Setter TargetName="WaferCtrl_FrontView" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="#FF6398CC" />
                                        <GradientStop Offset="1" Color="#FF6398CC" />
                                        <GradientStop Offset="0.5" Color="#FFF0F8FF" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_WaferBG" Property="Stroke" Value="#FF232200" />
                            <Setter TargetName="SSC_WaferBG" Property="Fill" Value="#FFADD8E6" />
                            <Setter TargetName="SSC_Wafer1" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00E6E4AD" />
                                        <GradientStop Offset="1" Color="#00E6E4AD" />
                                        <GradientStop Offset="0.45" Color="White" />
                                        <GradientStop Offset="0.55" Color="White" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_Wafer2" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00ADD8E6" />
                                        <GradientStop Offset="1" Color="#00ADD8E6" />
                                        <GradientStop Offset="0.5" Color="#FF6398CC" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="tb_tooltip" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="WaferStatus" Value="2">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Stroke" Value="#FF000B14" />
                            <Setter TargetName="WaferCtrl_FrontView" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="#FF3333FF" />
                                        <GradientStop Offset="1" Color="#FF3333FF" />
                                        <GradientStop Offset="0.5" Color="#FFE1E1FF" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_WaferBG" Property="Stroke" Value="#FF001154" />
                            <Setter TargetName="SSC_WaferBG" Property="Fill" Value="#FF6E6EFF" />
                            <Setter TargetName="SSC_Wafer1" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00E1E1FF" />
                                        <GradientStop Offset="1" Color="#00E1E1FF" />
                                        <GradientStop Offset="0.45" Color="#FFE1E1FF" />
                                        <GradientStop Offset="0.55" Color="#FFE1E1FF" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_Wafer2" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#000000FF" />
                                        <GradientStop Offset="1" Color="#000000FF" />
                                        <GradientStop Offset="0.5" Color="#FF3D3DFF" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="WaferStatus" Value="3">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Stroke" Value="#FF000B14" />
                            <Setter TargetName="WaferCtrl_FrontView" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="Cyan" />
                                        <GradientStop Offset="1" Color="Cyan" />
                                        <GradientStop Offset="0.5" Color="#FFE7F5F9" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_WaferBG" Property="Stroke" Value="#FF001154" />
                            <Setter TargetName="SSC_WaferBG" Property="Fill" Value="#FF00E4E4" />
                            <Setter TargetName="SSC_Wafer1" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#0000FFFF" />
                                        <GradientStop Offset="1" Color="#0000FFFF" />
                                        <GradientStop Offset="0.45" Color="White" />
                                        <GradientStop Offset="0.55" Color="White" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_Wafer2" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#0000FFFF" />
                                        <GradientStop Offset="1" Color="#0000FFFF" />
                                        <GradientStop Offset="0.5" Color="#FF00B2B2" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="WaferStatus" Value="4">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Stroke" Value="#FF000B14" />
                            <Setter TargetName="WaferCtrl_FrontView" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="#FF00B400" />
                                        <GradientStop Offset="1" Color="#FF00B400" />
                                        <GradientStop Offset="0.5" Color="#FFA9FFA9" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_WaferBG" Property="Stroke" Value="#FF002700" />
                            <Setter TargetName="SSC_WaferBG" Property="Fill" Value="#FF19FF19" />
                            <Setter TargetName="SSC_Wafer1" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00B3FFB3" />
                                        <GradientStop Offset="1" Color="#00B3FFB3" />
                                        <GradientStop Offset="0.45" Color="White" />
                                        <GradientStop Offset="0.55" Color="White" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_Wafer2" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00008000" />
                                        <GradientStop Offset="1" Color="#00008000" />
                                        <GradientStop Offset="0.5" Color="#FF00A300" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="WaferStatus" Value="5">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Stroke" Value="#FF000B14" />
                            <Setter TargetName="WaferCtrl_FrontView" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="Red" />
                                        <GradientStop Offset="1" Color="Red" />
                                        <GradientStop Offset="0.5" Color="#FFFFD7D7" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_WaferBG" Property="Stroke" Value="#FF500000" />
                            <Setter TargetName="SSC_WaferBG" Property="Fill" Value="#FFFF5D5D" />
                            <Setter TargetName="SSC_Wafer1" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="1" Color="#00FF0000" />
                                        <GradientStop Offset="0.45" Color="White" />
                                        <GradientStop Offset="0.55" Color="White" />
                                        <GradientStop Color="#00FF0000" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_Wafer2" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00FF0000" />
                                        <GradientStop Offset="1" Color="#00FF0000" />
                                        <GradientStop Offset="0.5" Color="Red" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="WaferStatus" Value="6">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Stroke" Value="#FF232200" />
                            <Setter TargetName="WaferCtrl_FrontView" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="#FFB88700" />
                                        <GradientStop Offset="1" Color="#FFB88700" />
                                        <GradientStop Offset="0.5" Color="#FFF7E0A0" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_WaferBG" Property="Stroke" Value="#FF232200" />
                            <Setter TargetName="SSC_WaferBG" Property="Fill" Value="#FFFFBB00" />
                            <Setter TargetName="SSC_Wafer1" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00E6E4AD" />
                                        <GradientStop Offset="1" Color="#00E6E4AD" />
                                        <GradientStop Offset="0.45" Color="White" />
                                        <GradientStop Offset="0.55" Color="White" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_Wafer2" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00E6E4AD" />
                                        <GradientStop Offset="1" Color="#00E6E4AD" />
                                        <GradientStop Offset="0.5" Color="#FFAF8100" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="tb_tooltip" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="WaferStatus" Value="7">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Stroke" Value="#FF232200" />
                            <Setter TargetName="WaferCtrl_FrontView" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="#FFFFFF00" />
                                        <GradientStop Offset="1" Color="#FFFFFF00" />
                                        <GradientStop Offset="0.5" Color="#FFFFF59D" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_WaferBG" Property="Stroke" Value="#FF232200" />
                            <Setter TargetName="SSC_WaferBG" Property="Fill" Value="#FFFFFF00" />
                            <Setter TargetName="SSC_Wafer1" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00E6E4AD" />
                                        <GradientStop Offset="1" Color="#00E6E4AD" />
                                        <GradientStop Offset="0.45" Color="White" />
                                        <GradientStop Offset="0.55" Color="White" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_Wafer2" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00E6E4AD" />
                                        <GradientStop Offset="1" Color="#00E6E4AD" />
                                        <GradientStop Offset="0.5" Color="#FFFFFF00" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="tb_tooltip" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="WaferStatus" Value="8">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Stroke" Value="#FF232200" />
                            <Setter TargetName="WaferCtrl_FrontView" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="#FFFF00FF" />
                                        <GradientStop Offset="1" Color="#FFFF00FF" />
                                        <GradientStop Offset="0.5" Color="#FFD8BFD8" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_WaferBG" Property="Stroke" Value="#FF232200" />
                            <Setter TargetName="SSC_WaferBG" Property="Fill" Value="#FFFF00FF" />
                            <Setter TargetName="SSC_Wafer1" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00E6E4AD" />
                                        <GradientStop Offset="1" Color="#00E6E4AD" />
                                        <GradientStop Offset="0.45" Color="White" />
                                        <GradientStop Offset="0.55" Color="White" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_Wafer2" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00D8BFD8" />
                                        <GradientStop Offset="1" Color="#00D8BFD8" />
                                        <GradientStop Offset="0.5" Color="#FFFF00FF" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="tb_tooltip" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="WaferStatus" Value="11">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Stroke" Value="#FF232200" />
                            <Setter TargetName="WaferCtrl_FrontView" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="#FF708090" />
                                        <GradientStop Offset="1" Color="#FF708090" />
                                        <GradientStop Offset="0.5" Color="#FFBEBEBE" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_WaferBG" Property="Stroke" Value="#FF000000" />
                            <Setter TargetName="SSC_WaferBG" Property="Fill" Value="#FF708090" />
                            <Setter TargetName="SSC_Wafer1" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00E6E4AD" />
                                        <GradientStop Offset="1" Color="#00E6E4AD" />
                                        <GradientStop Offset="0.45" Color="White" />
                                        <GradientStop Offset="0.55" Color="White" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_Wafer2" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00D8BFD8" />
                                        <GradientStop Offset="1" Color="#00D8BFD8" />
                                        <GradientStop Offset="0.5" Color="#FF708090" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="tb_tooltip" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="WaferStatus" Value="12">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Stroke" Value="#FF000B14" />
                            <Setter TargetName="WaferCtrl_FrontView" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="Red" />
                                        <GradientStop Offset="1" Color="Red" />
                                        <GradientStop Offset="0.5" Color="#FFFFD7D7" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_WaferBG" Property="Stroke" Value="#FF500000" />
                            <Setter TargetName="SSC_WaferBG" Property="Fill" Value="#FFFF5D5D" />
                            <Setter TargetName="SSC_Wafer1" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="1" Color="#00FF0000" />
                                        <GradientStop Offset="0.45" Color="White" />
                                        <GradientStop Offset="0.55" Color="White" />
                                        <GradientStop Color="#00FF0000" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_Wafer2" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00FF0000" />
                                        <GradientStop Offset="1" Color="#00FF0000" />
                                        <GradientStop Offset="0.5" Color="Red" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="WaferStatus" Value="13">
                            <Setter TargetName="WaferCtrl_FrontView" Property="Stroke" Value="#FF000B14" />
                            <Setter TargetName="WaferCtrl_FrontView" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                                        <GradientStop Offset="0" Color="Red" />
                                        <GradientStop Offset="1" Color="Red" />
                                        <GradientStop Offset="0.5" Color="#FFFFD7D7" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_WaferBG" Property="Stroke" Value="#FF500000" />
                            <Setter TargetName="SSC_WaferBG" Property="Fill" Value="#FFFF5D5D" />
                            <Setter TargetName="SSC_Wafer1" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="1" Color="#00FF0000" />
                                        <GradientStop Offset="0.45" Color="White" />
                                        <GradientStop Offset="0.55" Color="White" />
                                        <GradientStop Color="#00FF0000" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="SSC_Wafer2" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00FF0000" />
                                        <GradientStop Offset="1" Color="#00FF0000" />
                                        <GradientStop Offset="0.5" Color="Red" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type local:Slot}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Slot}">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <local:Wafer
                                DuplicatedVisibility="{Binding Path=DuplicatedVisibility, RelativeSource={RelativeSource TemplatedParent}}"
                                LotID="{Binding Path=LotID, RelativeSource={RelativeSource TemplatedParent}}"
                                ModuleID="{Binding Path=ModuleID, RelativeSource={RelativeSource TemplatedParent}}"
                                SlotID="{Binding Path=SlotID, RelativeSource={RelativeSource TemplatedParent}}"
                                SourceName="{Binding Path=SourceName, RelativeSource={RelativeSource TemplatedParent}}"
                                ViewType="{Binding Path=ViewType, RelativeSource={RelativeSource TemplatedParent}}"
                                WaferStatus="{Binding Path=WaferStatus, RelativeSource={RelativeSource TemplatedParent}}"
                                WaferTooltip="{Binding Path=WaferTooltip, RelativeSource={RelativeSource TemplatedParent}}" />
                            <Grid x:Name="BorderView" Visibility="Collapsed">
                                <Rectangle
                                    x:Name="Front_Border"
                                    Width="92"
                                    Height="13"
                                    Margin="-1"
                                    Stroke="#FFFFD200"
                                    Visibility="Collapsed" />
                                <Ellipse
                                    x:Name="Top_Border"
                                    Width="67"
                                    Height="67"
                                    Margin="-1"
                                    Stroke="#FFFFD200"
                                    Visibility="Collapsed" />
                                <Ellipse
                                    x:Name="Chamber_Border"
                                    Width="80"
                                    Height="6"
                                    Margin="-6"
                                    Stroke="#FFFFD200"
                                    Visibility="Collapsed" />
                            </Grid>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ViewType" Value="Front">
                            <Setter TargetName="Front_Border" Property="Visibility" Value="Visible" />
                            <Setter TargetName="Top_Border" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Chamber_Border" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="ViewType" Value="Top">
                            <Setter TargetName="Front_Border" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Top_Border" Property="Visibility" Value="Visible" />
                            <Setter TargetName="Chamber_Border" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="ViewType" Value="Chamber">
                            <Setter TargetName="Front_Border" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Top_Border" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Chamber_Border" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="ModuleID" Value="">
                            <Setter TargetName="Front_Border" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Top_Border" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Chamber_Border" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <DataTrigger Binding="{Binding Path=BorderStatus, RelativeSource={RelativeSource Self}, Converter={StaticResource borderConverter}}" Value="MouseOver">
                            <Setter TargetName="BorderView" Property="Visibility" Value="Visible" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Path=BorderStatus, RelativeSource={RelativeSource Self}, Converter={StaticResource borderConverter}}" Value="Selected">
                            <Setter TargetName="Front_Border" Property="Stroke" Value="#FFA55300" />
                            <Setter TargetName="Top_Border" Property="Stroke" Value="#FFA55300" />
                            <Setter TargetName="BorderView" Property="Visibility" Value="Visible" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Path=BorderStatus, RelativeSource={RelativeSource Self}, Converter={StaticResource borderConverter}}" Value="TransferSource">
                            <Setter TargetName="Front_Border" Property="Stroke" Value="#FF00EFEA" />
                            <Setter TargetName="Top_Border" Property="Stroke" Value="#FF00EFEA" />
                            <Setter TargetName="BorderView" Property="Visibility" Value="Visible" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Path=BorderStatus, RelativeSource={RelativeSource Self}, Converter={StaticResource borderConverter}}" Value="TransferTarget">
                            <Setter TargetName="Front_Border" Property="Stroke" Value="#FF00E704" />
                            <Setter TargetName="Top_Border" Property="Stroke" Value="#FF00E704" />
                            <Setter TargetName="BorderView" Property="Visibility" Value="Visible" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style BasedOn="{StaticResource ResourceKey={x:Type Window}}" TargetType="{x:Type wnd:CustomWnd}">
        <Setter Property="WindowStyle" Value="SingleBorderWindow" />
        <Setter Property="AllowsTransparency" Value="False" />
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="UseLayoutRounding" Value="True" />
        <Setter Property="WindowChrome.WindowChrome">
            <Setter.Value>
                <WindowChrome
                    CornerRadius="0"
                    GlassFrameThickness="1"
                    NonClientFrameEdges="None"
                    ResizeBorderThickness="5"
                    UseAeroCaptionButtons="False" />
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type wnd:CustomWnd}">
                    <Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="30" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="5" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="5" />
                        </Grid.ColumnDefinitions>
                        <AdornerDecorator
                            Grid.Row="1"
                            Grid.Column="1"
                            KeyboardNavigation.IsTabStop="False">
                            <ContentPresenter x:Name="MainContentPresenter" KeyboardNavigation.TabNavigation="Cycle" />
                        </AdornerDecorator>
                        <Border
                            x:Name="OuterBorder_LeftTop"
                            Background="{DynamicResource OuterBorder_BG_TopConner}"
                            BorderBrush="{DynamicResource OuterBorder_BD_Highlight}"
                            BorderThickness="1,1,0,0" />
                        <Border
                            x:Name="Top_BG"
                            Grid.Column="1"
                            Background="{DynamicResource OuterBorder_BG_Top}"
                            BorderBrush="{DynamicResource OuterBorder_BD_Highlight}"
                            BorderThickness="0,1,0,0" />
                        <Border
                            x:Name="OuterBorder_RightTop"
                            Grid.Column="2"
                            Background="{DynamicResource OuterBorder_BG_TopConner}"
                            BorderBrush="{DynamicResource OuterBorder_BD_Highlight}"
                            BorderThickness="0,1,0,0"
                            RenderTransformOrigin="0.5,0.5">
                            <Border.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="-1" ScaleY="1" />
                                    <SkewTransform AngleX="0" AngleY="0" />
                                    <RotateTransform Angle="0" />
                                    <TranslateTransform />
                                </TransformGroup>
                            </Border.RenderTransform>
                            <Border BorderBrush="{DynamicResource OuterBorder_BD_Shadow}" BorderThickness="1,0,0,0" />
                        </Border>
                        <Grid
                            x:Name="PART_WindowTitleGrid"
                            Grid.Row="0"
                            Grid.Column="1"
                            Height="30"
                            Background="LightGray">
                            <StackPanel
                                Margin="10,0,10,0"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Center"
                                Orientation="Horizontal">
                                <!--<Path Data="M6.1,8.2 L19.7,8.2 18.5,10 13.3,10 10.1,15.9 7,15.9 10.6,10 4.7,10 z M18.8,1.2 C18.8,1.2 25.9,2.1 25.6,6.4 25.2,13.2 12,14.3 12,14.3 L13.1,12.2 C13.1,12.2 22.5,11.5 23.5,6.5 24.1,3.6 18.1,2.5 18.1,2.5 z M14.6,1 L13.8,2.4 C8.7,2.8 2.9,5.2 2.5,8.7 2.4,10.8 7.6,12.1 7.6,12.1 L6.5,14.1 C6.5,14.1 -0.6,12.6 0,8.5 1.1,1.9 14.6,1 14.6,1 z M16.5,0 L18.4,0 15.7,5.3 21.8,5.3 20.5,7 6.8,7 7.9,5.2 13.4,5.2 z" Fill="{DynamicResource Color_BG_SmallLogo}" Height="15.9" Stretch="Fill" Width="25.6"/>-->
                                <TextBlock
                                    VerticalAlignment="Center"
                                    Foreground="{TemplateBinding Foreground}"
                                    Text="{TemplateBinding Title}" />
                            </StackPanel>

                            <!--<Grid>
                                <TextBlock Text="{Binding CurrentViewPathName}" HorizontalAlignment="Stretch" VerticalAlignment="Center" TextAlignment="Center"> </TextBlock>
                            </Grid>-->

                            <StackPanel
                                Margin="5,0"
                                HorizontalAlignment="Right"
                                VerticalAlignment="Center"
                                Orientation="Horizontal">
                                <Button
                                    xmlns:lex="https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension"
                                    Width="35"
                                    Height="22"
                                    Margin="0,0,5,0"
                                    lex:ResxLocalizationProvider.DefaultAssembly="Sicentury.Localization"
                                    lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
                                    Command="{Binding Source={x:Static lex:LocalizeDictionary.Instance}, Path=SetCultureCommand}"
                                    CommandParameter=""
                                    Content="{lex:Loc ID_APP_BTN_LANG_SW_Content}"
                                    IsTabStop="False"
                                    Style="{DynamicResource SysBtnStyle}"
                                    ToolTip="{lex:Loc ID_APP_BTN_LANG_SW_ToolTip}"
                                    WindowChrome.IsHitTestVisibleInChrome="True" />


                                <Button
                                    Width="35"
                                    Height="22"
                                    Margin="0,0,5,0"
                                    Command="{x:Static SystemCommands.ShowSystemMenuCommand}"
                                    IsTabStop="False"
                                    Style="{DynamicResource SysBtnStyle}"
                                    WindowChrome.IsHitTestVisibleInChrome="True">
                                    <Button.Content>
                                        <Path
                                            Width="10"
                                            Height="10"
                                            Fill="Black"
                                            Stretch="Uniform">
                                            <Path.Data>
                                                <GeometryGroup>
                                                    <PathGeometry Figures="m30 4.6871c-13.97 0-25.313 11.343-25.313 25.313 0.0001 13.97 11.343 25.313 25.313 25.313s25.313-11.343 25.313-25.313-11.343-25.313-25.313-25.313z" />
                                                    <PathGeometry Figures="m30.014 10.198c1.228 0 2.255 0.432 3.125 1.302s1.302 1.91 1.302 3.153c0 1.29-0.432 2.386-1.302 3.24-0.87 0.855-1.897 1.273-3.125 1.273-1.211 0-2.254-0.432-3.124-1.302s-1.331-1.952-1.331-3.211c0-1.212 0.461-2.238 1.331-3.124s1.913-1.331 3.124-1.331zm0 13.394c1.104 0 1.978 0.383 2.662 1.128 0.699 0.731 1.041 1.646 1.041 2.749v18.427c0 1.104-0.342 2.016-1.041 2.778-0.684 0.745-1.558 1.128-2.662 1.128-1.087 0-1.991-0.383-2.69-1.128-0.684-0.762-1.041-1.674-1.041-2.778v-18.427c0-1.103 0.357-2.018 1.041-2.749 0.699-0.745 1.603-1.128 2.69-1.128z" />
                                                </GeometryGroup>
                                            </Path.Data>
                                        </Path>
                                    </Button.Content>
                                </Button>

                                <Button
                                    Width="35"
                                    Height="22"
                                    Command="{x:Static SystemCommands.MinimizeWindowCommand}"
                                    IsTabStop="False"
                                    Style="{DynamicResource SysBtnStyle}"
                                    WindowChrome.IsHitTestVisibleInChrome="True">
                                    <Button.Content>
                                        <Rectangle
                                            Width="10"
                                            Height="3"
                                            Fill="{DynamicResource Color_FG_Button_Window}"
                                            StrokeThickness="3" />
                                    </Button.Content>
                                </Button>
                                <Button
                                    x:Name="PART_MAX"
                                    Width="35"
                                    Height="22"
                                    IsTabStop="False"
                                    Style="{DynamicResource SysBtnStyle}"
                                    WindowChrome.IsHitTestVisibleInChrome="True" />
                                <Button
                                    Width="35"
                                    Height="22"
                                    Command="{x:Static SystemCommands.CloseWindowCommand}"
                                    IsTabStop="False"
                                    Style="{DynamicResource SysCloseBtnStyle}"
                                    WindowChrome.IsHitTestVisibleInChrome="True">
                                    <Button.Content>
                                        <Path
                                            Width="10"
                                            Height="10"
                                            Margin="10.5,3"
                                            Data="M5.5,0 L8.5,0 8.5,5.5 14,5.5 14,8.5 8.5,8.5 8.5,14 5.5,14 5.5,8.5 0,8.5 0,5.5 5.5,5.5 z"
                                            Fill="{DynamicResource Color_FG_Button_Window}"
                                            RenderTransformOrigin="0.5,0.5"
                                            Stretch="Fill"
                                            StrokeThickness="3">
                                            <Path.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform />
                                                    <SkewTransform />
                                                    <RotateTransform Angle="45" />
                                                    <TranslateTransform />
                                                </TransformGroup>
                                            </Path.RenderTransform>
                                        </Path>
                                    </Button.Content>
                                </Button>
                            </StackPanel>
                        </Grid>
                        <Border
                            x:Name="Left_BG"
                            Grid.Row="1"
                            Background="{DynamicResource OuterBorder_BG_Side}"
                            BorderBrush="{DynamicResource OuterBorder_BD_Highlight}"
                            BorderThickness="1,0,0,0" />
                        <Border
                            x:Name="Right_BG"
                            Grid.Row="1"
                            Grid.Column="2"
                            Background="{DynamicResource OuterBorder_BG_Side}"
                            BorderBrush="{DynamicResource OuterBorder_BD_Shadow}"
                            BorderThickness="1,0,0,0"
                            RenderTransformOrigin="0.5,0.5">
                            <Border.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="-1" ScaleY="1" />
                                    <SkewTransform AngleX="0" AngleY="0" />
                                    <RotateTransform Angle="0" />
                                    <TranslateTransform />
                                </TransformGroup>
                            </Border.RenderTransform>
                        </Border>
                        <Border
                            x:Name="OuterBorder_LeftBottom"
                            Grid.Row="2"
                            Background="{DynamicResource OuterBorder_BG_BottomConner}"
                            BorderBrush="{DynamicResource OuterBorder_BD_Highlight}"
                            BorderThickness="1,0,0,0"
                            RenderTransformOrigin="0.5,0.5">
                            <Border.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="-1" />
                                    <SkewTransform AngleX="0" AngleY="0" />
                                    <RotateTransform Angle="0" />
                                    <TranslateTransform />
                                </TransformGroup>
                            </Border.RenderTransform>
                            <Border BorderBrush="{DynamicResource OuterBorder_BD_Shadow}" BorderThickness="0,1,0,0" />
                        </Border>
                        <Border
                            x:Name="Bottom_BG"
                            Grid.Row="2"
                            Grid.Column="1"
                            Background="{DynamicResource OuterBorder_BG_Bottom}"
                            BorderBrush="{DynamicResource OuterBorder_BD_Shadow}"
                            BorderThickness="0,0,0,1" />
                        <Border
                            x:Name="OuterBorder_RightBottom"
                            Grid.Row="2"
                            Grid.Column="2"
                            Background="{DynamicResource OuterBorder_BG_BottomConner}"
                            BorderBrush="{DynamicResource OuterBorder_BD_Shadow}"
                            BorderThickness="1,1,0,0"
                            RenderTransformOrigin="0.5,0.5">
                            <Border.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="-1" ScaleY="-1" />
                                    <SkewTransform AngleX="0" AngleY="0" />
                                    <RotateTransform Angle="0" />
                                    <TranslateTransform />
                                </TransformGroup>
                            </Border.RenderTransform>
                        </Border>
                        <ResizeGrip
                            x:Name="ResizeGrip"
                            Grid.Row="2"
                            Grid.Column="2"
                            HorizontalAlignment="Right"
                            VerticalAlignment="Bottom"
                            IsTabStop="False"
                            Visibility="Hidden"
                            WindowChrome.ResizeGripDirection="BottomRight" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="WindowState" Value="Maximized">
                            <Setter TargetName="LayoutRoot" Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(WindowChrome.WindowChrome).ResizeBorderThickness}" />
                            <Setter TargetName="PART_MAX" Property="Command" Value="{x:Static SystemCommands.RestoreWindowCommand}" />
                            <Setter TargetName="PART_MAX" Property="Content">
                                <Setter.Value>
                                    <Path
                                        Width="12"
                                        Height="11"
                                        Data="M0.8,4 L0.8,8 7.2,8 7.2,4 z M0,3 L8,3 8,11 0,11 z M4,0 L12,0 12,8 8.5,8 8.5,5 11,5 11,1 5,1 5,2.5 4,2.5 z"
                                        Fill="{DynamicResource Color_FG_Button_Window}"
                                        Stretch="Fill"
                                        StrokeThickness="3" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>

                        <Trigger Property="WindowState" Value="Normal">
                            <Setter TargetName="LayoutRoot" Property="Margin" Value="0" />
                            <Setter TargetName="PART_MAX" Property="Command" Value="{x:Static SystemCommands.MaximizeWindowCommand}" />
                            <Setter TargetName="PART_MAX" Property="Content">
                                <Setter.Value>
                                    <Path
                                        Width="10"
                                        Height="10"
                                        Data="M1,1 L1,5 9,5 9,1 z M0,0 L10,0 10,8 0,8 z"
                                        Fill="{DynamicResource Color_FG_Button_Window}"
                                        Stretch="Fill"
                                        StrokeThickness="3" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>

                        <Trigger Property="IsActive" Value="False">
                            <Setter Property="BorderBrush" Value="#FF6F7785" />
                        </Trigger>

                        <Trigger Property="ResizeMode" Value="NoResize">
                            <Setter TargetName="PART_MAX" Property="Visibility" Value="Collapsed" />
                        </Trigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="ResizeMode" Value="CanResizeWithGrip" />
                                <Condition Property="WindowState" Value="Normal" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="ResizeGrip" Property="Visibility" Value="Visible" />
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type local:Gasline}">
        <Setter Property="Background" Value="{DynamicResource Color_BG_Gasline}" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Orientation" Value="Horizontal" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Width" Value="Auto" />
        <Setter Property="Height" Value="8" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Gasline}">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        SnapsToDevicePixels="True">
                        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <Rectangle
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch"
                                Fill="{DynamicResource Color_BG_GasLine_3DBG02}" />
                            <Rectangle
                                Height="1"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Top"
                                Fill="{DynamicResource Color_BD_GasLine_Border}" />
                            <Rectangle
                                Height="1"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Bottom"
                                Fill="{DynamicResource Color_BD_GasLine_Border}" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="HorizontalAlignment" Value="Center" />
                <Setter Property="VerticalAlignment" Value="Stretch" />
                <Setter Property="BorderThickness" Value="0" />
                <Setter Property="Width" Value="8" />
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:Gasline}">
                            <Border
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="True">
                                <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                    <Rectangle
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"
                                        Fill="{DynamicResource Color_BG_GasLine_3DBG01}" />
                                    <Rectangle
                                        Width="1"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Stretch"
                                        Fill="{DynamicResource Color_BD_GasLine_Border}" />
                                    <Rectangle
                                        Width="1"
                                        HorizontalAlignment="Right"
                                        VerticalAlignment="Stretch"
                                        Fill="{DynamicResource Color_BD_GasLine_Border}" />
                                </Grid>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type local:GaslineJoint}">
        <Setter Property="JointType" Value="CROSS" />
        <Setter Property="Width" Value="8" />
        <Setter Property="Height" Value="8" />
        <Setter Property="Background" Value="{DynamicResource Color_BG_Gasline}" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:GaslineJoint}">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        SnapsToDevicePixels="True">
                        <Viewbox>
                            <Canvas
                                x:Name="Fourth_Way"
                                Width="8"
                                Height="8">
                                <Path
                                    Width="8"
                                    Height="8"
                                    Data="M4,4 L8,8 0,8 z M0,0 L8,0 4,4 z"
                                    Fill="{DynamicResource Color_BG_GasLine_3DBG01}"
                                    Stretch="Fill" />
                                <Path
                                    Width="8"
                                    Height="8"
                                    Data="M8,0 L8,8 4,4 z M0,0 L4,4 0,8 z"
                                    Fill="{DynamicResource Color_BG_GasLine_3DBG02}"
                                    Stretch="Fill" />
                                <Rectangle
                                    Canvas.Top="7"
                                    Width="1"
                                    Height="1"
                                    Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                <Rectangle
                                    Canvas.Left="7"
                                    Canvas.Top="7"
                                    Width="1"
                                    Height="1"
                                    Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                <Rectangle
                                    Canvas.Left="7"
                                    Width="1"
                                    Height="1"
                                    Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                <Rectangle
                                    Width="1"
                                    Height="1"
                                    Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                            </Canvas>
                        </Viewbox>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="JointType" Value="LEFT_TOP">
                <Setter Property="Background" Value="{DynamicResource Color_BG_Gasline}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:GaslineJoint}">
                            <Border
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="True">
                                <Viewbox>
                                    <Canvas Width="8" Height="8">
                                        <Path
                                            Width="8"
                                            Height="8"
                                            Data="M0,0 L8,0 8,8 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG02}"
                                            Stretch="Fill" />
                                        <Path
                                            Width="8"
                                            Height="8"
                                            Data="M0,0 L8,8 0,8 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG01}"
                                            Stretch="Fill" />
                                        <Rectangle
                                            Width="8"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Canvas.Left="7"
                                            Canvas.Top="7"
                                            Width="1"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Canvas.Top="1"
                                            Width="1"
                                            Height="7"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                    </Canvas>
                                </Viewbox>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>

            <Trigger Property="JointType" Value="LEFT_BOTTOM">
                <Setter Property="Background" Value="{DynamicResource Color_BG_Gasline}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:GaslineJoint}">
                            <Border
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="True">
                                <Viewbox>
                                    <Canvas Width="8" Height="8">
                                        <Path
                                            Width="8"
                                            Height="8"
                                            Data="M0,0 L8,0 0,8 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG01}"
                                            Stretch="Fill" />
                                        <Path
                                            Width="8"
                                            Height="8"
                                            Data="M8,0 L8,8 0,8 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG02}"
                                            Stretch="Fill" />
                                        <Rectangle
                                            Canvas.Left="7"
                                            Width="1"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Width="1"
                                            Height="8"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Canvas.Left="1"
                                            Canvas.Top="7"
                                            Width="7"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                    </Canvas>
                                </Viewbox>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>

            <Trigger Property="JointType" Value="RIGHT_TOP">
                <Setter Property="Background" Value="{DynamicResource Color_BG_Gasline}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:GaslineJoint}">
                            <Border
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="True">
                                <Viewbox>
                                    <Canvas Width="8" Height="8">
                                        <Path
                                            Width="8"
                                            Height="8"
                                            Data="M0,0 L8,0 0,8 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG02}"
                                            Stretch="Fill" />
                                        <Path
                                            Width="8"
                                            Height="8"
                                            Data="M8,0 L8,8 0,8 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG01}"
                                            Stretch="Fill" />
                                        <Rectangle
                                            Canvas.Top="7"
                                            Width="1"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Width="8"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Canvas.Left="7"
                                            Canvas.Top="1"
                                            Width="1"
                                            Height="7"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                    </Canvas>
                                </Viewbox>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>

            <Trigger Property="JointType" Value="RIGHT_BOTTOM">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:GaslineJoint}">
                            <Border
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="True">
                                <Viewbox>
                                    <Canvas Width="8" Height="8">
                                        <Path
                                            Width="8"
                                            Height="8"
                                            Data="M0,0 L8,0 8,8 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG01}"
                                            Stretch="Fill" />
                                        <Path
                                            Width="8"
                                            Height="8"
                                            Data="M0,0 L8,8 0,8 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG02}"
                                            Stretch="Fill" />
                                        <Rectangle
                                            Width="1"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Canvas.Top="7"
                                            Width="7"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Canvas.Left="7"
                                            Width="1"
                                            Height="8"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                    </Canvas>
                                </Viewbox>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>

            <Trigger Property="JointType" Value="LEFT">
                <Setter Property="Background" Value="{DynamicResource Color_BG_Gasline}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:GaslineJoint}">
                            <Border
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="True">
                                <Viewbox>
                                    <Canvas Width="8" Height="8">
                                        <Path
                                            Width="8"
                                            Height="8"
                                            Data="M0,0 L8,0 8,8 0,8 4,4 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG01}"
                                            Stretch="Fill" />
                                        <Path
                                            Width="4"
                                            Height="8"
                                            Data="M0,0 L4,4 0,8 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG02}"
                                            Stretch="Fill" />
                                        <Rectangle
                                            Canvas.Left="7"
                                            Width="1"
                                            Height="8"
                                            Fill="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Width="1"
                                            Height="1"
                                            Fill="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Canvas.Top="7"
                                            Width="1"
                                            Height="1"
                                            Fill="{DynamicResource Color_BD_GasLine_Border}" />
                                    </Canvas>
                                </Viewbox>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>

            <Trigger Property="JointType" Value="UP">
                <Setter Property="Background" Value="{DynamicResource Color_BG_Gasline}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:GaslineJoint}">
                            <Border
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="True">
                                <Viewbox>
                                    <Canvas Width="8" Height="8">
                                        <Path
                                            Width="8"
                                            Height="4"
                                            Data="M0,0 L8,0 4,4 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG01}"
                                            Stretch="Fill" />
                                        <Path
                                            Width="8"
                                            Height="8"
                                            Data="M0,0 L4,4 8,0 8,8 0,8 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG02}"
                                            Stretch="Fill" />
                                        <Rectangle
                                            Canvas.Top="7"
                                            Width="8"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Width="1"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Canvas.Left="7"
                                            Width="1"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                    </Canvas>
                                </Viewbox>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>

            <Trigger Property="JointType" Value="RIGHT">
                <Setter Property="Background" Value="{DynamicResource Color_BG_Gasline}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:GaslineJoint}">
                            <Border
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="True">
                                <Viewbox>
                                    <Canvas Width="8" Height="8">
                                        <Path
                                            Width="8"
                                            Height="8"
                                            Data="M0,0 L8,0 4,4 8,8 0,8 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG01}"
                                            Stretch="Fill" />
                                        <Path
                                            Canvas.Left="4"
                                            Width="4"
                                            Height="8"
                                            Data="M4,0 L4,8 0,4 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG02}"
                                            Stretch="Fill" />
                                        <Rectangle
                                            Width="1"
                                            Height="8"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Canvas.Left="7"
                                            Width="1"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Canvas.Left="7"
                                            Canvas.Top="7"
                                            Width="1"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                    </Canvas>
                                </Viewbox>
                            </Border>
                        </ControlTemplate>

                    </Setter.Value>
                </Setter>
            </Trigger>

            <Trigger Property="JointType" Value="DOWN">
                <Setter Property="Background" Value="{DynamicResource Color_BG_Gasline}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:GaslineJoint}">
                            <Border
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="True">
                                <Viewbox>
                                    <Canvas Width="8" Height="8">
                                        <Path
                                            Width="8"
                                            Height="8"
                                            Data="M0,0 L8,0 8,8 4,4 0,8 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG02}"
                                            Stretch="Fill" />
                                        <Path
                                            Canvas.Top="4"
                                            Width="8"
                                            Height="4"
                                            Data="M4,0 L8,4 0,4 z"
                                            Fill="{DynamicResource Color_BG_GasLine_3DBG01}"
                                            Stretch="Fill" />
                                        <Rectangle
                                            Width="8"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Canvas.Top="7"
                                            Width="1"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                        <Rectangle
                                            Canvas.Left="7"
                                            Canvas.Top="7"
                                            Width="1"
                                            Height="1"
                                            Stroke="{DynamicResource Color_BD_GasLine_Border}" />
                                    </Canvas>
                                </Viewbox>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type local:CarrierContentControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:CarrierContentControl}">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <!--<unitControls:CarrierView  ></unitControls:CarrierView>-->

                        </Grid>
                    </Border>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
