<UserControl x:Class="ThickTcpUiInWindow.UIModule.DynAreaConnected"
             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:ThickTcpUiInWindow.UIModule"
             mc:Ignorable="d" >
    <UserControl.Resources>
    <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/ThickTcpUiInWindow;component/Converter/Dictionary_MyConv.xaml"/>
        </ResourceDictionary.MergedDictionaries>
        <Style TargetType="Border" x:Key="BorderStyle_background">
            <Setter Property="Background" Value="White"/>
            <Setter Property="Margin" Value="3"/>
            <Setter Property="CornerRadius" Value="3"/>
            <Setter Property="Effect">
                <Setter.Value>
                    <DropShadowEffect Color="Black" Direction="270" ShadowDepth="1" Opacity="0.23" />
                </Setter.Value>
            </Setter>
        </Style>
        <ControlTemplate x:Key="picture_button" TargetType="Button">
            <Border Name="border" BorderThickness="1" CornerRadius="5">
                <ContentPresenter Content="{TemplateBinding Content}"/>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter TargetName="border" Property="BorderBrush" Value="LightBlue"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter TargetName="border" Property="Background" Value="LightGray"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </ResourceDictionary>
    </UserControl.Resources>
    <Button Click="Border_FlyAD_Click" Template="{StaticResource ResourceKey=picture_button}" >
        <Border Style="{StaticResource BorderStyle_background}" Name="Border_Connected">
            <Border.Resources>
                <ResourceDictionary>
                    <Style TargetType="TextBlock" x:Key="TextBlockStyle_Connected">
                        <Setter Property="FontWeight" Value="Bold"/>
                        <Setter Property="FontFamily" Value="YouYuan"/>
                        <Setter Property="FontSize" Value="32"/>
                    </Style>
                    <Style TargetType="TextBlock" x:Key="TextBlockStyle_ItemHeader">
                        <Setter Property="FontWeight" Value="Bold"/>
                        <Setter Property="FontFamily" Value="YouYuan"/>
                        <Setter Property="FontSize" Value="12"/>
                        <Setter Property="HorizontalAlignment" Value="Left"/>
                        <Setter Property="Foreground" Value="#FF3B3B3B"/>
                    </Style>
                </ResourceDictionary>
            </Border.Resources>
            <Grid Margin="5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <StackPanel Orientation="Vertical" >
                    <TextBlock Text="AD卡连接" Style="{StaticResource TextBlockStyle_ItemHeader}" />
                    <Grid>
                        <TextBlock  Style="{StaticResource TextBlockStyle_Connected}" Foreground="{StaticResource Color_theme_activity}" Text="断开" Visibility="{Binding FLYADIsConnect, Converter={StaticResource visbilityconv}, ConverterParameter=HiddenWhenTrue}" />
                        <TextBlock  Style="{StaticResource TextBlockStyle_Connected}" Foreground="{StaticResource Color_theme_static}" Text="成功" Visibility="{Binding FLYADIsConnect, Converter={StaticResource visbilityconv}}" />
                    </Grid>
                </StackPanel>
                <StackPanel Orientation="Vertical" Margin="5,0" Grid.Column="1">
                    <TextBlock Text="服务连接" Style="{StaticResource TextBlockStyle_ItemHeader}" />
                    <Grid>
                        <TextBlock  Style="{StaticResource TextBlockStyle_Connected}" Foreground="{StaticResource Color_theme_activity}" Text="断开" Visibility="{Binding ServerIsConnected, Converter={StaticResource visbilityconv}, ConverterParameter=HiddenWhenTrue}" />
                        <TextBlock  Style="{StaticResource TextBlockStyle_Connected}" Foreground="{StaticResource Color_theme_static}" Text="成功" Visibility="{Binding ServerIsConnected, Converter={StaticResource visbilityconv}}" />
                    </Grid>
                </StackPanel>
                <StackPanel Orientation="Vertical" Grid.Column="2">
                    <TextBlock Text="剩余时间" Style="{StaticResource TextBlockStyle_ItemHeader}" />

                    <StackPanel Orientation="Horizontal" Background="Black" >
                        <!--<TextBlock Text="20000" FontSize="24" FontFamily="Microsoft Sans Serif" TextAlignment="Center" HorizontalAlignment="Center" Foreground="White" />-->
                        <TextBlock Text="{Binding Hrs,Converter={StaticResource ResourceKey=hrsconv}}" FontSize="24" FontFamily="Microsoft Sans Serif" TextAlignment="Center" HorizontalAlignment="Center" Foreground="White" />
                        <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="h" FontSize="12" Foreground="White"/>
                    </StackPanel>
                </StackPanel>
            </Grid>
        </Border>
    </Button>
</UserControl>
