<wnd:CustomWnd
    x:Class="SicUI.Client.MainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:cal="http://www.caliburn.org"
    xmlns:client="clr-namespace:SicUI.Client"
    xmlns:controls="clr-namespace:MECF.Framework.UI.Client.Ctrlib.Controls;assembly=MECF.Framework.UI.Client"
    xmlns:converter="clr-namespace:SicUI.Converter"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:deviceControl="clr-namespace:Aitex.Core.UI.DeviceControl;assembly=MECF.Framework.UI.Core"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:lex="http://wpflocalizeextension.codeplex.com"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:wnd="http://OpenSEMI.Ctrlib.com/presentation"
    Title="Sic Manual Edition"
    d:DataContext="{d:DesignInstance Type=client:MainViewModel,
                                     IsDesignTimeCreatable=False}"
    lex:LocalizeDictionary.DesignCulture="en"
    lex:ResxLocalizationProvider.DefaultAssembly="Sicentury.Localization"
    lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
    WindowStartupLocation="CenterScreen"
    WindowState="Maximized"
    mc:Ignorable="d">
    <Window.Resources>
        <client:CollectionLastIndexConverter x:Key="collectionLastIndexConverter" />
        <converter:IsReadOnlyModeToUserInfoNameBgConverter x:Key="IsReadOnlyModeToUserInfoNameBgConverter" />
    </Window.Resources>

    <Grid Background="{DynamicResource MainArea_BG}">
        <Grid
            x:Name="LoginPart"
            Panel.ZIndex="0"
            Background="{StaticResource Login_BG}">
            <Grid.Style>
                <Style>
                    <Style.Triggers>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsLogin}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Grid.Visibility" Value="Hidden" />
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsLogin}" Value="False" />
                                <Condition Binding="{Binding IsReadOnlyMode}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Grid.Visibility" Value="Hidden" />
                        </MultiDataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding IsLogin}" Value="False" />
                                <Condition Binding="{Binding IsReadOnlyMode}" Value="False" />
                            </MultiDataTrigger.Conditions>
                            <Setter Property="Grid.Visibility" Value="Visible" />
                        </MultiDataTrigger>
                    </Style.Triggers>
                </Style>
            </Grid.Style>
            <Ellipse
                MaxWidth="1000"
                MaxHeight="800"
                Fill="{DynamicResource Login_BG_Highlight}" />
            <Grid Width="590" Height="465">
                <Grid.Effect>
                    <DropShadowEffect
                        BlurRadius="30"
                        ShadowDepth="0"
                        Color="#FF0B1E5A" />
                </Grid.Effect>
                <Border
                    Background="{DynamicResource LoginPanel_BG}"
                    BorderBrush="{DynamicResource LoginPanel_BD}"
                    BorderThickness="1"
                    CornerRadius="3">
                    <Grid>
                        <Path
                            Width="590"
                            Height="252.338"
                            VerticalAlignment="Bottom"
                            Data="M0,0 L0.67857742,0.054499656 C95.091171,7.7605554 387.09985,38.266688 589.03564,132.3875 L590,132.84716 590,249.338 C590,250.99486 588.65686,252.338 587,252.338 L441.29346,252.338 440.83957,252.18517 C350.99802,222.35816 203.01686,189.00345 6.2653065,198.4652 L0,198.80318 z"
                            Fill="{DynamicResource LoginPanel_InnerGrow}"
                            Stretch="Fill" />
                        <Grid Margin="60,40">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="70" />
                                <RowDefinition Height="10" />
                                <RowDefinition />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
                                <TextBlock
                                    Margin="0,0,0,5"
                                    VerticalAlignment="Bottom"
                                    FontFamily="Arial"
                                    FontSize="50"
                                    FontWeight="Bold"
                                    Foreground="White"
                                    Text="Login"
                                    TextWrapping="Wrap" />
                                <TextBlock
                                    Margin="10,0,0,12"
                                    VerticalAlignment="Bottom"
                                    FontFamily="SimHei"
                                    FontSize="32"
                                    FontWeight="Bold"
                                    Foreground="White"
                                    Opacity="0.5"
                                    Text="登录"
                                    TextWrapping="Wrap" />
                            </StackPanel>
                            <StackPanel
                                Grid.Row="1"
                                Margin="-20,0"
                                Orientation="Horizontal">
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Fill="#19FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#7FFFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#33FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="50,0,0,0"
                                    Fill="#66FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#7FFFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#4CFFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#33FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#66FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#99FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#7FFFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="20,0,0,0"
                                    Fill="#99FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#B2FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#CCFFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#CCFFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#B2FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="50,0,0,0"
                                    Fill="#19FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#4CFFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#19FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="30,0,0,0"
                                    Fill="#4CFFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#66FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#33FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#33FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#66FFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#7FFFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#4CFFFFFF" />
                                <Rectangle
                                    Width="10"
                                    Height="10"
                                    Margin="3,0,0,0"
                                    Fill="#33FFFFFF" />
                            </StackPanel>
                            <Grid
                                Grid.Row="2"
                                Margin="40"
                                lex:ResxLocalizationProvider.DefaultDictionary="lang_config">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="130" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <TextBox
                                    x:Name="tbLoginName"
                                    Grid.Column="1"
                                    Height="45"
                                    VerticalAlignment="Center"
                                    Style="{DynamicResource Login_TextBox}"
                                    TabIndex="0"
                                    Text="LastLoginName"
                                    TextWrapping="Wrap" />
                                <PasswordBox
                                    x:Name="pdbPassword"
                                    Grid.Row="1"
                                    Grid.Column="1"
                                    Height="45"
                                    Style="{DynamicResource Login_PasswordBox}"
                                    TabIndex="1">
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="KeyDown">
                                            <cal:ActionMessage MethodName="PasswordBoxEnterKeyPressed">
                                                <cal:Parameter Value="$eventargs" />
                                                <cal:Parameter Value="{Binding ElementName=tbLoginName, Path=Text}" />
                                                <cal:Parameter Value="{Binding ElementName=pdbPassword}" />
                                                <cal:Parameter Value="{Binding ElementName=cbRole, Path=SelectedValue}" />
                                            </cal:ActionMessage>
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </PasswordBox>
                                <ComboBox
                                    x:Name="cbRole"
                                    Grid.Row="2"
                                    Grid.Column="1"
                                    Height="45"
                                    DisplayMemberPath="RoleName"
                                    ItemsSource="{Binding Roles}"
                                    SelectedIndex="0"
                                    Style="{DynamicResource Login_ComboBox}"
                                    TabIndex="2" />
                                <TextBlock
                                    Margin="0,0,20,0"
                                    HorizontalAlignment="Right"
                                    VerticalAlignment="Center"
                                    FontFamily="Arial"
                                    FontSize="16"
                                    FontWeight="Bold"
                                    Foreground="{DynamicResource FG_White}"
                                    Text="{lex:Loc ID_TXT_Login_Name}"
                                    TextWrapping="Wrap" />
                                <TextBlock
                                    Grid.Row="1"
                                    Margin="0,0,20,0"
                                    HorizontalAlignment="Right"
                                    VerticalAlignment="Center"
                                    FontFamily="Arial"
                                    FontSize="16"
                                    FontWeight="Bold"
                                    Foreground="{DynamicResource FG_White}"
                                    Text="{lex:Loc ID_TXT_Password}"
                                    TextWrapping="Wrap" />
                                <TextBlock
                                    Grid.Row="2"
                                    Margin="0,0,20,0"
                                    HorizontalAlignment="Right"
                                    VerticalAlignment="Center"
                                    FontFamily="Arial"
                                    FontSize="16"
                                    FontWeight="Bold"
                                    Foreground="{DynamicResource FG_White}"
                                    Text="{lex:Loc ID_TXT_Role}"
                                    TextWrapping="Wrap" />
                            </Grid>
                            <Button
                                x:Name="ID_BTN_Login_Content"
                                Grid.Row="3"
                                Width="160"
                                Height="55"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
                                Content="{lex:Loc}"
                                FontFamily="Arial"
                                FontSize="18"
                                FontWeight="Bold"
                                Style="{StaticResource Login_Button}">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="Click">
                                        <cal:ActionMessage MethodName="RequestLogin">
                                            <cal:Parameter Value="{Binding ElementName=tbLoginName, Path=Text}" />
                                            <cal:Parameter Value="{Binding ElementName=pdbPassword}" />
                                            <cal:Parameter Value="{Binding ElementName=cbRole, Path=SelectedValue}" />
                                        </cal:ActionMessage>
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </Button>
                        </Grid>
                    </Grid>
                </Border>
            </Grid>
        </Grid>

        <Border
            Margin="3,1"
            Padding="1"
            CornerRadius="4">
            <Grid x:Name="MainPage">
                <Grid.Style>
                    <Style>
                        <Style.Triggers>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding IsLogin}" Value="False" />
                                    <Condition Binding="{Binding IsReadOnlyMode}" Value="True" />
                                </MultiDataTrigger.Conditions>
                                <Setter Property="Grid.Visibility" Value="Visible" />
                            </MultiDataTrigger>
                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <Condition Binding="{Binding IsLogin}" Value="False" />
                                    <Condition Binding="{Binding IsReadOnlyMode}" Value="False" />
                                </MultiDataTrigger.Conditions>
                                <Setter Property="Grid.Visibility" Value="Hidden" />
                            </MultiDataTrigger>
                        </Style.Triggers>
                    </Style>
                </Grid.Style>

                <Grid.RowDefinitions>
                    <RowDefinition Height="120" />
                    <RowDefinition />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="70" />
                </Grid.RowDefinitions>
                <Grid x:Name="Top_Frame">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="30*" />
                    </Grid.RowDefinitions>
                    <Border Style="{DynamicResource TopFrame_Style}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="200" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="250" />
                                <ColumnDefinition Width="50" />
                                <ColumnDefinition Width="150" />
                            </Grid.ColumnDefinitions>
                            <!--<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="LOGO" VerticalAlignment="Center" FontFamily="Arial" Foreground="White" FontSize="50" FontWeight="Bold" Margin="10,0" FontStyle="Italic">
                                <TextBlock.Effect>
                                    <DropShadowEffect/>
                                </TextBlock.Effect>
                            </TextBlock>-->
                            <Image
                                Width="200"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Top"
                                Source="/SicUI;component/Resources/images/logo.png" />
                            <StackPanel
                                Margin="0,0,0,27"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Bottom"
                                Orientation="Horizontal">
                                <TextBlock
                                    Padding="5,0"
                                    FontSize="13"
                                    Foreground="white"
                                    Text="{lex:Loc ID_TXT_Time}" />
                                <TextBlock
                                    Padding="1,0"
                                    FontSize="13"
                                    Foreground="white"
                                    Text="{Binding RunTime}" />
                            </StackPanel>
                            <StackPanel
                                Margin="0,0,0,5"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Bottom"
                                Orientation="Horizontal">
                                <TextBlock
                                    Padding="5,0"
                                    FontSize="13"
                                    Foreground="white"
                                    Text="{lex:Loc ID_TXT_Ver}" />
                                <TextBlock
                                    Padding="5,0"
                                    FontSize="13"
                                    Foreground="white"
                                    Text="{Binding SoftwareVersion}" />
                            </StackPanel>
                            <Grid
                                Grid.Column="1"
                                Margin="-20,8,5,8"
                                ColumnSpan="2"
                                IsHitTestVisible="{Binding IsReadOnlyMode, Converter={StaticResource BoolReverseConverter}}">
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="1*" />
                                    <ColumnDefinition Width="1*" />
                                    <ColumnDefinition Width="1*" />
                                    <ColumnDefinition Width="1*" />
                                </Grid.ColumnDefinitions>
                                <Grid.Resources>
                                    <Style TargetType="controls:ModuleStatusIndicator">
                                        <Setter Property="Margin" Value="0,2,4,2" />
                                    </Style>
                                </Grid.Resources>
                                <controls:ModuleStatusIndicator
                                    Grid.Row="0"
                                    Grid.Column="0"
                                    cal:Message.Attach="[SetOnline] = [Action SetModuleOnline($source, $eventArgs)];[SetOffline] = [Action SetModuleOffline($source, $eventArgs)]"
                                    d:IsOnline="true"
                                    d:Status="Test"
                                    Caption="System"
                                    IsOnline="{Binding IsOnlineSystem}"
                                    ModuleDescription="All Module"
                                    ModuleName="System"
                                    Status="{Binding RtStatus}" />
                                <controls:ModuleStatusIndicator
                                    Grid.Row="0"
                                    Grid.Column="1"
                                    cal:Message.Attach="[SetOnline] = [Action SetModuleOnline($source, $eventArgs)];[SetOffline] = [Action SetModuleOffline($source, $eventArgs)]"
                                    Caption="TM"
                                    HasWarning="{Binding IsTMWarning}"
                                    IsOnline="{Binding IsOnlineTM}"
                                    ModuleDescription="TM"
                                    ModuleName="TM"
                                    Status="{Binding TMStatus}"
                                    WarningTip="{Binding TMWarningMessage}" />
                                <controls:ModuleStatusIndicator
                                    Grid.Row="0"
                                    Grid.Column="2"
                                    cal:Message.Attach="[SetOnline] = [Action SetModuleOnline($source, $eventArgs)];[SetOffline] = [Action SetModuleOffline($source, $eventArgs)]"
                                    Caption="LL"
                                    IsOnline="{Binding IsOnlineLL}"
                                    ModuleDescription="LoadLock"
                                    ModuleName="LoadLock"
                                    Status="{Binding LLStatus}" />
                                <controls:ModuleStatusIndicator
                                    Grid.Row="0"
                                    Grid.Column="3"
                                    cal:Message.Attach="[SetOnline] = [Action SetModuleOnline($source, $eventArgs)];[SetOffline] = [Action SetModuleOffline($source, $eventArgs)]"
                                    Caption="Buffer"
                                    IsOnline="{Binding IsOnlineBuffer}"
                                    ModuleDescription="Buffer"
                                    ModuleName="Buffer"
                                    Status="{Binding BufferStatus}" />
                                <controls:ModuleStatusIndicator
                                    Grid.Row="1"
                                    Grid.Column="0"
                                    cal:Message.Attach="[SetOnline] = [Action SetModuleOnline($source, $eventArgs)];[SetOffline] = [Action SetModuleOffline($source, $eventArgs)]"
                                    Caption="PM1"
                                    HasWarning="{Binding IsPM1Warning}"
                                    IsOnline="{Binding IsOnlinePM1}"
                                    ModuleDescription="PM1"
                                    ModuleName="PM1"
                                    Status="{Binding PM1Status}"
                                    WarningTip="{Binding PM1WarningMessage}" />
                                <controls:ModuleStatusIndicator
                                    Grid.Row="1"
                                    Grid.Column="1"
                                    cal:Message.Attach="[SetOnline] = [Action SetModuleOnline($source, $eventArgs)];[SetOffline] = [Action SetModuleOffline($source, $eventArgs)]"
                                    Caption="PM2"
                                    HasWarning="{Binding IsPM2Warning}"
                                    IsOnline="{Binding IsOnlinePM2}"
                                    ModuleDescription="PM2"
                                    ModuleName="PM2"
                                    Status="{Binding PM2Status}"
                                    WarningTip="{Binding PM2WarningMessage}" />
                                <controls:ModuleStatusIndicator
                                    Grid.Row="1"
                                    Grid.Column="2"
                                    cal:Message.Attach="[SetOnline] = [Action SetModuleOnline($source, $eventArgs)];[SetOffline] = [Action SetModuleOffline($source, $eventArgs)]"
                                    Caption="UnLoad"
                                    IsOnline="{Binding IsOnlineUnLoad}"
                                    ModuleDescription="UnLoad"
                                    ModuleName="UnLoad"
                                    Status="{Binding UnLoadStatus}" />

                                <DockPanel
                                    Grid.Row="2"
                                    Grid.Column="0"
                                    Grid.ColumnSpan="4"
                                    Margin="0,2"
                                    LastChildFill="True">

                                    <Label
                                        Width="100"
                                        HorizontalContentAlignment="Center"
                                        VerticalContentAlignment="Center"
                                        BorderBrush="Gray"
                                        Content="{lex:Loc ID_TXT_Log}"
                                        DockPanel.Dock="Left"
                                        Style="{DynamicResource TopLable_LeftBottom}" />
                                    <Button
                                        Width="90"
                                        Height="30"
                                        Margin="2,0,0,0"
                                        Content="{lex:Loc ID_BTN_BuzzerOff_Content}"
                                        DockPanel.Dock="Right"
                                        Style="{DynamicResource TopButton}"
                                        ToolTip="{lex:Loc ID_BTN_BuzzerOff_ToolTip}">
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="Click">
                                                <cal:ActionMessage MethodName="BuzzerOff" />
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </Button>
                                    <Button
                                        Width="90"
                                        Height="30"
                                        Margin="2,0,0,0"
                                        Content="{lex:Loc ID_BTN_Reset_Content}"
                                        DockPanel.Dock="Right"
                                        Style="{DynamicResource TopButton}"
                                        ToolTip="{lex:Loc ID_BTN_Reset_ToolTip}">
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="Click">
                                                <cal:ActionMessage MethodName="Reset" />
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </Button>
                                    <Label
                                        Width="90"
                                        Height="30"
                                        HorizontalContentAlignment="Center"
                                        VerticalContentAlignment="Center"
                                        DockPanel.Dock="Right"
                                        Style="{DynamicResource TopLable_RightBottom}">
                                        <CheckBox
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Content="{lex:Loc ID_CBX_Alarm_Content}"
                                            FontFamily="Arial"
                                            FontSize="16"
                                            Foreground="{DynamicResource FG_Black}"
                                            IsChecked="{Binding IsShowAlarmEventOnly, Delay=10}"
                                            ToolTip="{lex:Loc ID_CBX_Alarm_ToolTip}" />
                                    </Label>
                                    <ComboBox
                                        Height="Auto"
                                        VerticalContentAlignment="Center"
                                        FontSize="15"
                                        ItemsSource="{Binding EventLogsView}"
                                        SelectedIndex="{Binding EventLogsView.Count, Mode=OneWay, Converter={StaticResource collectionLastIndexConverter}}"
                                        Style="{DynamicResource Top_ComboBox}"
                                        Visibility="{Binding AllEventsVisibility}" />

                                </DockPanel>
                            </Grid>
                            <Label
                                Grid.Column="3"
                                Width="50"
                                Margin="0,5"
                                VerticalAlignment="Stretch"
                                HorizontalContentAlignment="Center"
                                VerticalContentAlignment="Center"
                                Style="{DynamicResource TopLable_SignalTower}">
                                <Viewbox Width="45" Height="80">
                                    <deviceControl:AITSignalTower
                                        Width="45"
                                        Height="110"
                                        DeviceData="{Binding SignalTowerData}" />
                                </Viewbox>
                            </Label>
                            <Grid Grid.Column="4" Margin="5,10">
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Border
                                    Margin="2,4"
                                    Background="{Binding IsReadOnlyMode, Converter={StaticResource IsReadOnlyModeToUserInfoNameBgConverter}}"
                                    BorderBrush="{DynamicResource TopFrame_UserInfoBD}"
                                    BorderThickness="1"
                                    CornerRadius="5"
                                    SnapsToDevicePixels="True">
                                    <TextBlock
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        FontFamily="Arial"
                                        FontSize="16"
                                        Foreground="{DynamicResource TopFrame_TextColor}"
                                        Text="{Binding User.LoginName}"
                                        TextWrapping="NoWrap" />
                                </Border>
                                <Button
                                    Grid.Row="1"
                                    Margin="2,4"
                                    Content="{lex:Loc ID_BTN_Logout_Content}"
                                    Style="{DynamicResource Logout_Button}"
                                    ToolTip="{lex:Loc ID_BTN_Logout_ToolTip}">
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="Click">
                                            <cal:ActionMessage MethodName="ShowLogoutDialog" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </Button>
                            </Grid>
                        </Grid>
                    </Border>
                </Grid>
                <Grid
                    x:Name="GdContentContainer"
                    Grid.Row="1"
                    d:Background="{StaticResource MainArea_BG}"
                    Background="{Binding BgActiveContent, Mode=OneWay}"
                    IsHitTestVisible="{Binding IsReadOnlyMode, Converter={StaticResource BoolReverseConverter}}"
                    PreviewKeyDown="GdContentContainer_OnPreviewKeyDown">
                    <Border>
                        <!--<Border.Background>
                            <ImageBrush ImageSource="/Resources/Images/interlock_bypass_watermark.png"
                                        TileMode="Tile" Opacity="0.15" ViewportUnits="Absolute"
                                        Viewport="0,-20,250,200" Viewbox="0,0,1.5,1.5" Stretch="Fill"
                                        ViewboxUnits="RelativeToBoundingBox" />
                        </Border.Background>-->
                    </Border>
                    <ContentControl
                        x:Name="ActiveItem"
                        Margin="10"
                        cal:View.Context="{Binding Context}"
                        cal:View.Model="{Binding ActiveItem}" />
                </Grid>
                <Border
                    x:Name="Sub_Menu_Bar"
                    Grid.Row="2"
                    Style="{DynamicResource Sub_Menu_BarStyle}">
                    <Menu
                        Grid.Row="0"
                        Margin="3,0"
                        lex:ResxLocalizationProvider.DefaultDictionary="lang_menu_view"
                        Background="{x:Null}"
                        ItemContainerStyle="{DynamicResource BottomSubMenu}"
                        ItemsSource="{Binding Path=SubMenuItems}">
                        <Menu.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Margin="1" Text="{lex:Loc {Binding Path=ResKey, FallbackValue=Unknown}}" />
                            </DataTemplate>
                        </Menu.ItemTemplate>
                    </Menu>
                </Border>
                <Border
                    x:Name="Bottom_Frame"
                    Grid.Row="3"
                    Style="{DynamicResource Bottom_FrameStyle}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="150" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="160" />
                        </Grid.ColumnDefinitions>
                        <!--<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="LOGO" VerticalAlignment="Center" FontFamily="Arial" Foreground="White" FontSize="50" FontWeight="Bold" Margin="9,10,1743,2" FontStyle="Italic" RenderTransformOrigin="-5.298,-0.284"/>-->
                        <!--<Image Source="/SicUI;component/Themes/images/parts/logo1.png" Margin="10,0,0,0"></Image>-->
                        <Menu x:Name="MainMenu"
                            Grid.Row="0"
                            Grid.Column="1"
                            Grid.ColumnSpan="2"
                            Margin="10,0"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            lex:ResxLocalizationProvider.DefaultDictionary="lang_menu_view"
                            Background="{x:Null}"
                            ItemContainerStyle="{DynamicResource MainMenu}"
                            ItemsSource="{Binding Path=MenuItems}">
                            <Menu.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Margin="1" Text="{lex:Loc {Binding Path=ResKey, FallbackValue=Unknown}}" />
                                </DataTemplate>
                            </Menu.ItemTemplate>
                        </Menu>

                        <Grid Grid.Column="2" ClipToBounds="True">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Border Grid.RowSpan="2" Background="#66737373" RenderTransformOrigin="0.5,0.5" >
                                <Border.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform AngleX="-34"/>
                                        <RotateTransform/>
                                        <TranslateTransform X="28"/>
                                    </TransformGroup>
                                </Border.RenderTransform>
                            </Border>
                            <TextBlock Grid.Row="0" Text="Equipment ID" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,11,0" Foreground="#7FF4F4F4"/>
                            <TextBlock Grid.Row="1"  d:Text="SiC-0001" 
                                       Text="{Binding EquipmentName}"
                                       HorizontalAlignment="Right" 
                                       VerticalAlignment="Center" FontSize="20" 
                                       Foreground="White" FontFamily="Segoe UI" 
                                       Margin="0,0,10,10">
                                <TextBlock.Effect>
                                    <DropShadowEffect Color="LightGray" ShadowDepth="2" BlurRadius="5" Direction="250"/>
                                </TextBlock.Effect>
                            </TextBlock>
                        </Grid>
                    </Grid>
                </Border>
            </Grid>
        </Border>


        <Grid  Background="{DynamicResource MainArea_BG}" Visibility="{Binding IsPlcAbortProcessView, Converter={StaticResource BoolVisibilityConverter}, FallbackValue=Collapsed}">
            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                <Label
                    Margin="0,100"
                    FontSize="35"
                    Foreground="Red">
                    PLC and the computer are accidentally disconnected, PLC abort running, Please wait ...
                </Label>
                <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" >
                    <Button
                        Width="140"
                        Height="40"
                        Content="ShutDownPLCRun"
                        Foreground="Red"
                        ToolTip="强制关闭PLC宕机流程" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <cal:ActionMessage MethodName="ShutDownPLCRun" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Button>
                    <Button
                        Width="100"
                        Height="40"
                        Margin="20,0,0,0"
                        Content="BuzzerOFF"
                        ToolTip="消除PLC 宕机产生的蜂鸣器声音" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <cal:ActionMessage MethodName="PLCProcessBuzzerOFF" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Button>
                </StackPanel>
            </StackPanel>
        </Grid>


    </Grid>

</wnd:CustomWnd>
