<Window x:Class="Txgy.EWS.Client.Upgrade.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Txgy.EWS.Client.Upgrade"
        xmlns:controls="clr-namespace:Txgy.EWS.Client.Upgrade.Controls"
         FontSize="13" FontFamily="Microsoft YaHei" FontWeight="ExtraLight" Foreground="#333"
        mc:Ignorable="d" Background="Transparent" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
        Title="在线更新" Height="500" Width="800">
    <WindowChrome.WindowChrome>
        <WindowChrome GlassFrameThickness="-1" ResizeBorderThickness="0" CaptionHeight="30"/>
    </WindowChrome.WindowChrome>
    <Grid Margin="1">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="2*"/>
        </Grid.ColumnDefinitions>

        <Border Background="#F7F9FA"/>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="10,0">
                <TextBlock Text="在线更新" FontSize="13" Foreground="#444" VerticalAlignment="Center" HorizontalAlignment="Center"/>
            </StackPanel>

            <StackPanel Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="70,30">
                <controls:WaterProgress Margin="0,40" Value="{Binding Progress}"/>
                <TextBlock Text="正在更新...." VerticalAlignment="Center" HorizontalAlignment="Center" LineHeight="30"/>
                <TextBlock Text="4 / 10" VerticalAlignment="Center" HorizontalAlignment="Center" LineHeight="23"/>
                <Button Content="开始更新" Height="30" Margin="0,40,0,0" Foreground="White" Background="Orange" BorderThickness="0"
                        Command="{Binding StartCommand}"/>
            </StackPanel>
            <TextBlock Text="© 2022 天香国悦" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Center" FontSize="10" Foreground="#888" Margin="0,0,0,10"/>
        </Grid>

        <Grid Grid.Column="1" Margin="0,40,0,10" Visibility="Collapsed">
            <StackPanel>
                <Grid Margin="10,2" Height="30" Background="#F7F9FA">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="40"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>
                    <ProgressBar Grid.ColumnSpan="4" Height="30" Value="50" BorderThickness="0" Background="Transparent" Foreground="#5AB5FFDA"/>
                    <TextBlock Text="01" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    <TextBlock Text="Txgy.EWS.Modules" Grid.Column="1" VerticalAlignment="Center"/>
                    <TextBlock Text="正在更新" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12"/>
                </Grid>
                <Grid Margin="10,2" Height="30">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="40"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>
                    <ProgressBar Grid.ColumnSpan="4" Height="30" Value="0" BorderThickness="0" Background="Transparent" Foreground="#5AB5FFDA"/>
                    <TextBlock Text="02" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    <TextBlock Text="Txgy.EWS.Modules" Grid.Column="1" VerticalAlignment="Center"/>
                    <TextBlock Text="完成" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12"/>
                </Grid>
                <Grid Margin="10,2" Height="30" Background="#F7F9FA">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="40"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>
                    <ProgressBar Grid.ColumnSpan="4" Height="30" Value="30" BorderThickness="0" Background="Transparent" Foreground="#5AB5FFDA"/>
                    <TextBlock Text="03" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    <TextBlock Text="Txgy.EWS.Assets" Grid.Column="1" VerticalAlignment="Center"/>
                    <TextBlock Text="正在更新" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12"/>
                </Grid>
                <Grid Margin="10,2" Height="30">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="40"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>
                    <ProgressBar Grid.ColumnSpan="4" Height="30" Value="70" BorderThickness="0" Background="Transparent" Foreground="#5AB5FFDA"/>
                    <TextBlock Text="04" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    <TextBlock Text="Txgy.Txgy.Microseismic.BaseLib" Grid.Column="1" VerticalAlignment="Center"/>
                    <TextBlock Text="正在更新" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12"/>
                </Grid>
                <Grid Margin="10,2" Height="30" Background="#F7F9FA">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="40"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>
                    <ProgressBar Grid.ColumnSpan="4" Height="30" Value="20" BorderThickness="0" Background="Transparent" Foreground="#5AB5FFDA"/>
                    <TextBlock Text="05" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    <TextBlock Text="Txgy.EWS.Modules" Grid.Column="1" VerticalAlignment="Center"/>
                    <TextBlock Text="正在更新" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12"/>
                </Grid>
                <Grid Margin="10,2" Height="30">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="40"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>
                    <ProgressBar Grid.ColumnSpan="4" Height="30" Value="0" BorderThickness="0" Background="Transparent" Foreground="#5AB5FFDA"/>
                    <TextBlock Text="06" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    <TextBlock Text="Txgy.EWS.Modules" Grid.Column="1" VerticalAlignment="Center"/>
                    <TextBlock Text="完成" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12"/>
                </Grid>
                <Grid Margin="10,2" Height="30" Background="#F7F9FA">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="40"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>
                    <ProgressBar Grid.ColumnSpan="4" Height="30" Value="0" BorderThickness="0" Background="Transparent" Foreground="#5AB5FFDA"/>
                    <TextBlock Text="07" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    <TextBlock Text="Txgy.EWS.Modules" Grid.Column="1" VerticalAlignment="Center"/>
                    <TextBlock Text="完成" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12"/>
                </Grid>
                <Grid Margin="10,2" Height="30">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="40"/>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>
                    <ProgressBar Grid.ColumnSpan="4" Height="30" Value="0" BorderThickness="0" Background="Transparent" Foreground="#5AB5FFDA"/>
                    <TextBlock Text="08" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    <TextBlock Text="Txgy.EWS.Modules" Grid.Column="1" VerticalAlignment="Center"/>
                    <TextBlock Text="完成" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12"/>
                </Grid>
            </StackPanel>
        </Grid>
        <ScrollViewer Grid.Column="1" Margin="0,40,0,10" VerticalScrollBarVisibility="Auto">
            <ItemsControl ItemsSource="{Binding FileList}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Grid Margin="10,2" Height="30">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="40"/>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="80"/>
                            </Grid.ColumnDefinitions>
                            <ProgressBar Grid.ColumnSpan="4" Height="30" Value="{Binding Progress}" BorderThickness="0" Background="Transparent" Foreground="#5AB5FFDA"/>
                            <TextBlock Text="{Binding Index,StringFormat=\{0:00\}}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            <TextBlock Grid.Column="1" VerticalAlignment="Center">
                                <Run Text="{Binding FileName}" FontSize="14"/>
                                <Run Text="{Binding ErrorMsg}" FontSize="11" Foreground="Red"/>
                            </TextBlock>
                            <TextBlock Text="{Binding State}" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12"/>
                        </Grid>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>
    </Grid>
</Window>
