<base:WpfUiWindow
    x:Class="Bloxstrap.UI.Elements.Bootstrapper.FluentDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:base="clr-namespace:Bloxstrap.UI.Elements.Base"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:resources="clr-namespace:Bloxstrap.Resources"
    xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
    xmlns:vms="clr-namespace:Bloxstrap.UI.ViewModels.Bootstrapper"
    Width="500"
    Height="280"
    MinHeight="0"
    d:DataContext="{d:DesignInstance vms:FluentDialogViewModel,
                                     IsDesignTimeCreatable=True}"
    Background="{ui:ThemeResource ApplicationBackgroundBrush}"
    Closing="UiWindow_Closing"
    ExtendsContentIntoTitleBar="True"
    ResizeMode="NoResize"
    WindowBackdropType="{Binding Path=WindowBackdropType, Mode=OneTime}"
    WindowStartupLocation="CenterScreen"
    WindowStyle="None"
    mc:Ignorable="d">

    <Window.TaskbarItemInfo>
        <TaskbarItemInfo ProgressState="{Binding Path=TaskbarProgressState}" ProgressValue="{Binding Path=TaskbarProgressValue}" />
    </Window.TaskbarItemInfo>

    <!--  Background is for Aero theme only  -->
    <Grid Background="{Binding Path=BackgroundColourBrush, Mode=OneTime}">
        <!--  Allow for drag  -->
        <ui:TitleBar
            VerticalAlignment="Top"
            CanMaximize="False"
            ShowClose="False"
            ShowMaximize="False"
            ShowMinimize="False" />

        <Grid Margin="32,16">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Image
                Grid.Row="0"
                Width="80"
                Height="80"
                Margin="0,30,0,0"
                HorizontalAlignment="Center"
                VerticalAlignment="Top"
                RenderOptions.BitmapScalingMode="HighQuality"
                Source="{Binding Icon, Mode=OneWay}" />

            <TextBlock
                Grid.Row="1"
                Margin="0,0,0,8"
                HorizontalAlignment="Center"
                FontSize="18"
                Foreground="{DynamicResource TextFillColorPrimaryBrush}"
                Text="{Binding Message, Mode=OneWay}"
                TextWrapping="Wrap" />

            <ProgressBar
                Grid.Row="2"
                Margin="0,0,0,16"
                IsIndeterminate="{Binding ProgressIndeterminate, Mode=OneWay}"
                Maximum="{Binding ProgressMaximum, Mode=OneWay}"
                Value="{Binding ProgressValue, Mode=OneWay}" />

            <Button
                Grid.Row="3"
                Width="120"
                Padding="4"
                HorizontalAlignment="Center"
                Command="{Binding CancelInstallCommand}"
                Content="{x:Static resources:Strings.Common_Cancel}"
                FontSize="14"
                IsEnabled="{Binding CancelEnabled, Mode=OneWay}" />
        </Grid>
    </Grid>
</base:WpfUiWindow>
