<cont:BaseWindow xmlns="https://github.com/avaloniaui"
        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:cont="clr-namespace:NetSparkleUpdater.UI.Avalonia.Controls"
        mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
                 x:Class="NetSparkleUpdater.UI.Avalonia.DownloadProgressWindow"
        Width="600"
        MaxWidth="600"
        Title="Software Update"
        CanResize="False"
        SizeToContent="Height"
        WindowStartupLocation="CenterScreen">

  <Grid Margin="5"
        x:Name="MainGrid"
        ColumnDefinitions="Auto, *"
        RowDefinitions="Auto, Auto, Auto, Auto, Auto">
    <Image Grid.Row="0"
           Grid.RowSpan="2"
           Grid.Column="0"
           x:Name="AppIcon"
           VerticalAlignment="Top"
           HorizontalAlignment="Left"
           Width="48"
           Height="48"
           Margin="10,10,5,0" />
    <TextBlock Name="DownloadingTitle"
           Grid.Row="0"
           Grid.Column="1"
           Text="{Binding DownloadingTitle}"
           HorizontalAlignment="Left"
           FontWeight="Bold"
           FontSize="20" />
    <TextBlock Name="DownloadProgress"
           Grid.Row="1"
           Grid.Column="1"
           Text="{Binding UserReadableDownloadProgress}"
           HorizontalAlignment="Left"
           FontWeight="Bold"
           FontSize="20" />
    <ProgressBar Name="ProgressBar"
                 Grid.Row="2"
                 Grid.Column="0"
                 Grid.ColumnSpan="2"
                 Minimum="0"
                 Maximum="100"
                 IsIndeterminate="False"
                 Height="25"
                 Value="{Binding DownloadProgress}"
                 Margin="5,0,5,0" />
    <TextBlock TextWrapping="Wrap"
               Name="ErrorMessage"
               Grid.Row="3"
               Grid.Column="0"
               Margin="5,5,0,5"
               Grid.ColumnSpan="2"
               Text="{Binding ErrorMessageText}"
               IsVisible="{Binding IsErrorMessageVisible}"
               HorizontalAlignment="Left"
               FontWeight="Regular"
               FontSize="16" />
    <Button Name="ActionButton"
            IsVisible="{Binding IsActionButtonVisible}"
            Grid.Row="4"
            Grid.Column="0"
            Grid.ColumnSpan="2"
            Content="{Binding ActionButtonTitle}"
            FontSize="16"
            HorizontalAlignment="Center"
            Padding="10,5,10,5"
            Margin="0,10,0,10"
            Click="ActionButton_Click" />
  </Grid>
</cont:BaseWindow>
