<UserControl x:Class="NEIntelligentControl2.Views.Matrix.WindStationBlock"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:NEIntelligentControl2.Views.Matrix"
             xmlns:basic="clr-namespace:NEIntelligentControl2.Views.Basic"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <Style x:Key="TitleSytle" TargetType="TextBlock">
            <Setter Property="Background" Value="DarkGray"/>
            <Setter Property="Padding" Value="14,3"/>
        </Style>
    </UserControl.Resources>
    <Border Margin="0,1" BorderBrush="#FF575757" BorderThickness="1">
        <Grid Margin="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <StackPanel Orientation="Horizontal" Background="#FF99B4D1">
                <TextBlock Background="SeaShell" Text="{Binding RelativeSource={ RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}, Path=StationInfo.FullName}" MinWidth="100" Style="{StaticResource TitleSytle}"/>
                <TextBlock Text="接入台数" Style="{StaticResource TitleSytle}"/>
                <TextBlock Background="White" Text="{Binding RelativeSource={ RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}, Path=CountTotal}" Style="{StaticResource TitleSytle}"/>
                <TextBlock Text="并网" Style="{StaticResource TitleSytle}"/>
                <TextBlock Text="{Binding RelativeSource={ RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}, Path=CountConnect}" Style="{StaticResource TitleSytle}" Background="#FFC8EAFF"/>
                <TextBlock Text="待机" Style="{StaticResource TitleSytle}"/>
                <TextBlock Text="{Binding RelativeSource={ RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}, Path=CountStandby}" Style="{StaticResource TitleSytle}" Background="#FFCFF1E8"/>
                <TextBlock Text="停机" Style="{StaticResource TitleSytle}"/>
                <TextBlock Text="{Binding RelativeSource={ RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}, Path=CountStopped}" Style="{StaticResource TitleSytle}" Background="#FF7E7935"/>
                <TextBlock Text="维护" Style="{StaticResource TitleSytle}"/>
                <TextBlock Text="{Binding RelativeSource={ RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}, Path=CountMaintain}" Style="{StaticResource TitleSytle}" Background="#FFFF720E"/>
                <TextBlock Text="故障" Style="{StaticResource TitleSytle}"/>
                <TextBlock Text="{Binding RelativeSource={ RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}, Path=CountFault}" Style="{StaticResource TitleSytle}" Background="#FFDB3333"/>
                <TextBlock Text="离线" Style="{StaticResource TitleSytle}"/>
                <TextBlock Text="{Binding RelativeSource={ RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}, Path=CountOffline}" Background="#FFF4F4F4" Style="{StaticResource TitleSytle}"/>
            </StackPanel>

            <basic:OptionalUniformGrid x:Name="_OPUGMain" Grid.Row="1" Columns="23" MinHeight="70"/>

            <Grid.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="启动" Click="MenuItem_Click" Tag="Start"/>
                    <MenuItem Header="停机" Click="MenuItem_Click" Tag="Stop"/>
                    <MenuItem Header="复位" Click="MenuItem_Click" Tag="Reset"/>
                    <MenuItem Header="维护" Click="MenuItem_Click" Tag="Maintain"/>
                    <MenuItem Header="取消维护" Click="MenuItem_Click" Tag="UnMaintain"/>
                    <MenuItem Header="挂牌">
                        <MenuItem Header="检修" Click="MenuItem_Click_Lock" Tag="CheckLock"/>
                        <MenuItem Header="故障维修" Click="MenuItem_Click_Lock" Tag="FaultLock"/>
                        <MenuItem Header="场内受累检修" Click="MenuItem_Click_Lock" Tag="StationCheckLock"/>
                        <MenuItem Header="场内受累故障" Click="MenuItem_Click_Lock" Tag="StationFaulLock"/>
                        <MenuItem Header="场外受累电网" Click="MenuItem_Click_Lock" Tag="StationPowerLineLock"/>
                        <MenuItem Header="场外受累天气" Click="MenuItem_Click_Lock" Tag="StationWeatherLock"/>
                        <MenuItem Header="自定义" Click="MenuItem_Click_Lock" Tag="CustomerLock"/>
                    </MenuItem>
                    <MenuItem Header="取消挂牌" Click="MenuItem_Click_Lock" Tag="UnLock"/>
                    <MenuItem Header="参数对比" Click="MenuItem_Click" Tag="compar"/>
                </ContextMenu>
            </Grid.ContextMenu>
        </Grid>
    </Border>
</UserControl>
