<Page x:Class="WSDDBBrowser.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"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="Page_Main">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Margin="30" HorizontalAlignment="Center">
            <StackPanel.Resources>
                <Style x:Key="AccentCircleButtonStyle2"
                           BasedOn="{StaticResource AccentCircleButtonStyle}"
                           TargetType="{x:Type ButtonBase}">
                    <Setter Property="Width" Value="96"/>
                    <Setter Property="Height" Value="96"/>
                </Style>
                <Style x:Key="AccentCircleIconPackStyle2"
                       BasedOn="{StaticResource AccentCircleIconPackStyle}"
                       TargetType="{x:Type iconPacks:PackIconBase}">
                    <Setter Property="Width" Value="40"/>
                    <Setter Property="Height" Value="40"/>
                </Style>
            </StackPanel.Resources>
            <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                <StackPanel Orientation="Horizontal" Margin="0,-20,-100,0">
                    <TextBlock Text="Step 1" FontSize="20" Foreground="{DynamicResource AccentColorBrush}" />
                    <TextBlock Text="选择数据" VerticalAlignment="Bottom" Margin="4,0"/>
                </StackPanel>
                <Button Style="{StaticResource AccentCircleButtonStyle2}" Click="ButtonSelect_Click">
                    <iconPacks:PackIconMaterial Style="{StaticResource AccentCircleIconPackStyle2}"
                                           Kind="DatabaseImport" />
                </Button>
                <Grid Margin="0,0,-100,-100" Visibility="{Binding IsDBReady, Converter={StaticResource visbilityconv}}">
                    <StackPanel Orientation="Vertical" DataContext="{Binding CurrProcess}">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="订单号:"/>
                            <TextBlock FontSize="15" Text="{Binding OrderNo}"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="项目号:"/>
                            <TextBlock FontSize="15" Text="{Binding ProjectNo}"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="工艺号:"/>
                            <TextBlock FontSize="15" Text="{Binding TechnologyNo}"/>
                        </StackPanel>
                        <TextBlock Text="{Binding BeginTime,StringFormat={}{0:MM-dd HH:mm}}"/>
                        <TextBlock Text="{Binding EndTime,StringFormat={}{0:MM-dd HH:mm}}"/>
                    </StackPanel>
                </Grid>


            </StackPanel>
            <Line X2="96" VerticalAlignment="Center" Stroke="{DynamicResource GrayBrush7}" 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="{DynamicResource AccentColorBrush}" />
                    <TextBlock Text="查看图表" VerticalAlignment="Bottom" Margin="4,0"/>
                </StackPanel>
                <Button Style="{StaticResource AccentCircleButtonStyle2}" Click="ButtonChart_Click" IsEnabled="{Binding IsDBReady}">
                    <iconPacks:PackIconMaterial Style="{StaticResource AccentCircleIconPackStyle2}"
                                           Kind="ChartAreaspline" />
                </Button>
            </StackPanel>
            <Line X2="96" VerticalAlignment="Center" Stroke="{DynamicResource GrayBrush7}" 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="{DynamicResource AccentColorBrush}" />
                    <TextBlock Text="导出excel" VerticalAlignment="Bottom" Margin="4,0"/>
                </StackPanel>
                <Button Style="{StaticResource AccentCircleButtonStyle2}" Click="ButtonExcel_Click" IsEnabled="{Binding IsDBReady}">
                    <iconPacks:PackIconModern Style="{StaticResource AccentCircleIconPackStyle2}"
                                       Kind="OfficeExcel" />
                </Button>
            </StackPanel>
        </StackPanel>
        <StackPanel Grid.Row="1" Orientation="Vertical" Margin="10,30">
            <Rectangle Height="1" Fill="{DynamicResource GrayBrush7}" Width="800"/>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="{StaticResource ControlMargin}">
                <StackPanel Orientation="Vertical">
                    <TextBlock Text="威仕达数据库浏览器" FontSize="25" Foreground="{DynamicResource AccentColorBrush}"/>

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