<UserControl x:Class="NEIntelligentControl2.Views.AGC.SimpleAGCCard"
             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.AGC"
             mc:Ignorable="d" 
             d:DesignHeight="97" d:DesignWidth="320" Cursor="Hand">
    <UserControl.Resources>
        <SolidColorBrush x:Key="BorderColor" Color="#FF31B9FB"/>
        <SolidColorBrush x:Key="ValueColor" Color="#FF33FFFF"/>

        <Style x:Key="TextStyle" TargetType="TextBlock">
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Foreground" Value="{StaticResource BorderColor}"/>
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="FontSize" Value="17"/>
            <Setter Property="Margin" Value="5,0"/>
        </Style>

        <Style x:Key="ValueStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="{StaticResource ValueColor}"/>
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="FontSize" Value="21"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="0,0,5,0"/>
            <Setter Property="FontWeight" Value="Bold"/>
        </Style>

    </UserControl.Resources>
    <Border BorderThickness="1,0,1,1" Background="#FF041831" BorderBrush="{StaticResource BorderColor}" Margin="-1,0,0,0">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="3*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>

            <TextBlock Grid.RowSpan="2" Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}, Path=Title}" Margin="3" VerticalAlignment="Center" HorizontalAlignment="Center" TextWrapping="Wrap" Foreground="{StaticResource BorderColor}" FontSize="15" FontWeight="Bold"/>

            <Border Grid.Column="1" BorderThickness="1,0,0,1" BorderBrush="{StaticResource BorderColor}" SnapsToDevicePixels="True">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>

                    <TextBlock Text="有功设定：" Style="{StaticResource TextStyle}"/>
                    <TextBlock Grid.Column="1" Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}, Path=PowerSet}" Style="{StaticResource ValueStyle}"/>
                    <TextBlock Grid.Column="2" Text="MW"  Style="{StaticResource TextStyle}"/>

                </Grid>
            </Border>

            <Border Grid.Column="1" Grid.Row="1" BorderThickness="1,0,0,0" BorderBrush="{StaticResource BorderColor}" SnapsToDevicePixels="True">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="实发有功：" Style="{StaticResource TextStyle}"/>
                    <TextBlock Grid.Column="1" Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}, Path=PowerActual}" Style="{StaticResource ValueStyle}"/>
                    <TextBlock Grid.Column="2" Text="MW" Style="{StaticResource TextStyle}"/>
                </Grid>
            </Border>
        </Grid>
    </Border>
</UserControl>
