<Page x:Class="FLY.Thick.FilmCasting.UI.DbViewer.PgMain"
      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:controls="http://metro.mahapps.com/winfx/xaml/controls"
        xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
      xmlns:local="clr-namespace:FLY.Thick.FilmCasting.UI.DbViewer.Core"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      d:DataContext="{d:DesignInstance local:DbViewerModel}"
      Title="Page_Main">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Margin="30" HorizontalAlignment="Center">
            <StackPanel.Resources>

            </StackPanel.Resources>
            <StackPanel VerticalAlignment="Center">
                <StackPanel Orientation="Horizontal" Margin="0,-20,-100,0">
                    <TextBlock Text="Step 1" FontSize="20" Foreground="{StaticResource MahApps.Brushes.Accent}" />
                    <TextBlock Text="选择数据" VerticalAlignment="Bottom" Margin="4,0"/>
                </StackPanel>
                <Button Style="{StaticResource Styles.Button.Circle.Accent2}" Click="ButtonSelect_Click">
                    <iconPacks:PackIconMaterial Kind="DatabaseImport" />
                </Button>
                <Grid Margin="0,0,-100,-45">
                    <StackPanel Visibility="{Binding IsPackReady, Converter={StaticResource visbilityconv}, Mode=OneWay}">
                        <TextBlock>
                            数据开始时间:<Run Text="{Binding PackBeginDate,StringFormat={}{0:yyyy-MM-dd HH:mm}, Mode=OneWay}"/>
                        </TextBlock>
                        <TextBlock>
                            数据结束时间:<Run Text="{Binding PackEndDate,StringFormat={}{0:yyyy-MM-dd HH:mm}, Mode=OneWay}"/>
                        </TextBlock>
                        <TextBlock>
                            数据批次:<Run Text="{Binding PackCnt, Mode=OneWay}"/>
                        </TextBlock>
                    </StackPanel>
                </Grid>


            </StackPanel>
            <Line X2="96" VerticalAlignment="Center" Stroke="{StaticResource MahApps.Brushes.Gray7}" StrokeThickness="3" Margin="40,0"/>
            <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                <StackPanel Orientation="Horizontal" Margin="0,-20,-100,0">
                    <TextBlock Text="Step 2" FontSize="20" Foreground="{StaticResource MahApps.Brushes.Accent}" />
                    <TextBlock Text="查看图表(暂不支持)" VerticalAlignment="Bottom" Margin="4,0"/>
                </StackPanel>
                <Button Style="{StaticResource Styles.Button.Circle.Accent2}" Click="ButtonChart_Click" IsEnabled="False">
                    <iconPacks:PackIconMaterial Kind="ChartAreaspline" />
                </Button>
            </StackPanel>
            <Line X2="96" VerticalAlignment="Center" Stroke="{StaticResource MahApps.Brushes.Gray7}" StrokeThickness="3" Margin="40,0"/>
            <StackPanel Orientation="Vertical" VerticalAlignment="Center" >
                <StackPanel Orientation="Horizontal" Margin="0,-20,-100,0">
                    <TextBlock Text="Step 3" FontSize="20" Foreground="{StaticResource MahApps.Brushes.Accent}" />
                    <TextBlock Text="导出excel" VerticalAlignment="Bottom" Margin="4,0"/>
                </StackPanel>
                <Button Style="{StaticResource Styles.Button.Circle.Accent2}" Click="ButtonExcel_Click" IsEnabled="{Binding IsPackReady}">
                    <iconPacks:PackIconMaterial Kind="MicrosoftExcel" />
                </Button>
            </StackPanel>
        </StackPanel>
        <StackPanel Grid.Row="1" Orientation="Vertical" Margin="10,30">
            <Rectangle Height="1" Fill="{StaticResource MahApps.Brushes.Gray7}" Width="800"/>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="{StaticResource ControlMargin}">
                <StackPanel Orientation="Vertical">
                    <Button Style="{StaticResource ButtonStyle_empty}"  Click="ButtonSetup_Click">
                        <TextBlock Text="流延数据库浏览器" FontSize="25">
                            <TextBlock.Style>
                                <Style TargetType="TextBlock">
                                    <Setter Property="Foreground" Value="{StaticResource MahApps.Brushes.Accent}"/>

                                </Style>
                            </TextBlock.Style>
                        </TextBlock>
                    </Button>


                </StackPanel>
                <TextBlock Text="by flyautomation" VerticalAlignment="Bottom" Margin="{StaticResource ControlMargin}"/>
            </StackPanel>

        </StackPanel>
    </Grid>
</Page>