<!--
// /***************************************************************************
// Aaru Data Preservation Suite
// ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
//
// Filename       : ImageVerify.xaml
// Author(s)      : Natalia Portillo <claunia@claunia.com>
//
// Component      : GUI windows.
//
// ‐‐[ Description ] ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
//
//     Image verification window.
//
// ‐‐[ License ] ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
//
//     This program is free software: you can redistribute it and/or modify
//     it under the terms of the GNU General public License as
//     published by the Free Software Foundation, either version 3 of the
//     License, or (at your option) any later version.
//
//     This program is distributed in the hope that it will be useful,
//     but WITHOUT ANY WARRANTY; without even the implied warranty of
//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//     GNU General public License for more details.
//
//     You should have received a copy of the GNU General public License
//     along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
// ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
// Copyright © 2011-2026 Natalia Portillo
// ****************************************************************************/
-->
<Window 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:windows="clr-namespace:Aaru.Gui.ViewModels.Windows"
        xmlns:localization="clr-namespace:Aaru.Localization;assembly=Aaru.Localization"
        xmlns:controls="clr-namespace:Aaru.Gui.Controls"
        mc:Ignorable="d"
        d:DesignWidth="800"
        d:DesignHeight="450"
        Width="640"
        Height="400"
        x:Class="Aaru.Gui.Views.Windows.ImageVerify"
        Icon="/Assets/aaru.png"
        x:DataType="windows:ImageVerifyViewModel"
        Title="{x:Static localization:UI.Title_Verify_image}">
    <Design.DataContext>
        <windows:ImageVerifyViewModel />
    </Design.DataContext>
    <Window.Styles>
        <Style Selector="DataGridRow:nth-child(2n)">
            <Setter Property="Background">
                <SolidColorBrush Color="#15FFFFFF" />
            </Setter>
        </Style>
        <Style Selector="DataGridRow:nth-child(2n):pointerover">
            <Setter Property="Background"
                    Value="{DynamicResource SystemControlHighlightListLowBrush}" />
        </Style>
        <Style Selector="DataGridRow:nth-child(2n):selected">
            <Setter Property="Background"
                    Value="{DynamicResource SystemControlHighlightAccentBrush}" />
        </Style>
    </Window.Styles>
    <Grid RowDefinitions="Auto,*,Auto"
          RowSpacing="8"
          Margin="12">
        <Grid Grid.Row="0"
              RowDefinitions="Auto,Auto,Auto"
              RowSpacing="8"
              IsVisible="{Binding OptionsVisible, Mode=OneWay}">
            <CheckBox Grid.Row="0"
                      IsChecked="{Binding VerifyImageChecked, Mode=TwoWay}"
                      IsEnabled="{Binding VerifyImageEnabled, Mode=OneWay}">
                <TextBlock Text="{x:Static localization:UI.Verify_media_image_if_supported}" />
            </CheckBox>
            <CheckBox Grid.Row="1"
                      IsChecked="{Binding VerifySectorsChecked, Mode=TwoWay}"
                      IsEnabled="{Binding VerifySectorsEnabled, Mode=OneWay}"
                      IsVisible="{Binding VerifySectorsVisible, Mode=OneWay}">
                <TextBlock Text="{x:Static localization:UI.Verify_all_sectors_if_supported}" />
            </CheckBox>
            <CheckBox Grid.Row="2"
                      IsChecked="{Binding VerifyOnlyDataChecked, Mode=TwoWay}"
                      IsEnabled="{Binding VerifySectorsEnabled, Mode=OneWay}"
                      IsVisible="{Binding VerifySectorsVisible, Mode=OneWay}">
                <TextBlock Text="{x:Static localization:UI.Verify_only_data_help}" />
            </CheckBox>
        </Grid>
        <Grid Grid.Row="1"
              RowDefinitions="*, Auto"
              RowSpacing="8"
              IsVisible="{Binding ResultsVisible, Mode=OneWay}">
            <Grid Grid.Row="0"
                  RowDefinitions="*, *"
                  RowSpacing="8">
                <Grid Grid.Row="0"
                      RowDefinitions="Auto, *"
                      RowSpacing="8"
                      IsVisible="{Binding SectorErrorsVisible, Mode=OneWay}">
                    <controls:SpectreTextBlock Grid.Row="0"
                                               Text="{x:Static localization:UI.LBAs_with_error}" />
                    <DataGrid Grid.Row="1"
                              ItemsSource="{Binding ErrorList, Mode=OneWay}">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="{x:Static localization:UI.Title_LBA}"
                                                Binding="{Binding Lba, Mode=OneWay}"
                                                Width="*" />
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
                <Grid Grid.Row="1"
                      RowDefinitions="Auto, *"
                      RowSpacing="8"
                      IsVisible="{Binding SectorsUnknownsVisible, Mode=OneWay}">
                    <controls:SpectreTextBlock Grid.Row="0"
                                               Text="{x:Static localization:UI.Unknown_LBAs}" />
                    <DataGrid Grid.Row="1"
                              ItemsSource="{Binding UnknownList, Mode=OneWay}">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="{x:Static localization:UI.Title_LBA}"
                                                Binding="{Binding Lba, Mode=OneWay}"
                                                Width="*" />
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </Grid>
            <StackPanel Grid.Row="1"
                        Spacing="8"
                        IsVisible="{Binding SectorSummaryVisible,Mode=OneWay}">
                <controls:SpectreTextBlock Text="{Binding ImageResultText, Mode=OneWay}"
                                           IsVisible="{Binding ImageResultVisible, Mode=OneWay}" />
                <controls:SpectreTextBlock Text="{x:Static localization:UI.All_sectors_contain_errors}"
                                           IsVisible="{Binding SectorsErrorsAllVisible, Mode=OneWay}" />
                <controls:SpectreTextBlock Text="{x:Static localization:UI.All_sectors_are_unknown}"
                                           IsVisible="{Binding SectorsUnknownAllVisible, Mode=OneWay}" />
                <StackPanel Orientation="Horizontal"
                            Spacing="8">
                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Total_sectors}" />
                    <controls:SpectreTextBlock Text="{Binding TotalSectorsText, Mode=OneWay}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal"
                            Spacing="8">
                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Total_errors}" />
                    <controls:SpectreTextBlock Text="{Binding TotalSectorErrorsText, Mode=OneWay}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal"
                            Spacing="8">
                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Total_unknowns}" />
                    <controls:SpectreTextBlock Text="{Binding TotalSectorUnknownsText, Mode=OneWay}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal"
                            Spacing="8">
                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Total_errors_plus_unknowns}" />
                    <controls:SpectreTextBlock Text="{Binding TotalSectorErrorsUnknownsText, Mode=OneWay}" />
                </StackPanel>
            </StackPanel>
        </Grid>
        <Grid Grid.Row="1"
              RowDefinitions="Auto,Auto"
              RowSpacing="8"
              IsVisible="{Binding ProgressVisible, Mode=OneWay}">
            <Grid RowDefinitions="Auto, Auto"
                  Grid.Row="0"
                  RowSpacing="8">
                <controls:SpectreTextBlock Grid.Row="0"
                                           Text="{Binding ProgressText, Mode=OneWay}" />
                <ProgressBar Grid.Row="1"
                             Maximum="{Binding ProgressMaxValue, Mode=OneWay}"
                             IsIndeterminate="{Binding ProgressIndeterminate, Mode=OneWay}"
                             Value="{Binding ProgressValue, Mode=OneWay}" />
            </Grid>
            <Grid Grid.Row="1"
                  RowDefinitions="Auto, Auto"
                  RowSpacing="8"
                  IsVisible="{Binding Progress2Visible, Mode=OneWay}">
                <controls:SpectreTextBlock Grid.Row="0"
                                           Text="{Binding Progress2Text, Mode=OneWay}" />
                <ProgressBar Grid.Row="1"
                             Maximum="{Binding Progress2MaxValue, Mode=OneWay}"
                             IsIndeterminate="{Binding Progress2Indeterminate, Mode=OneWay}"
                             Value="{Binding Progress2Value, Mode=OneWay}" />
            </Grid>
        </Grid>
        <StackPanel Grid.Row="2"
                    Orientation="Horizontal"
                    VerticalAlignment="Bottom"
                    HorizontalAlignment="Right"
                    Spacing="8">
            <Button Command="{Binding StartCommand, Mode=OneWay}"
                    IsVisible="{Binding StartVisible, Mode=OneWay}">
                <TextBlock Text="{x:Static localization:UI.ButtonLabel_Start}" />
            </Button>
            <Button Command="{Binding CloseCommand, Mode=OneWay}"
                    IsVisible="{Binding CloseVisible, Mode=OneWay}">
                <TextBlock Text="{x:Static localization:UI.ButtonLabel_Close}" />
            </Button>
            <Button Command="{Binding StopCommand, Mode=OneWay}"
                    IsVisible="{Binding StopVisible, Mode=OneWay}"
                    IsEnabled="{Binding StopEnabled, Mode=OneWay}">
                <TextBlock Text="{x:Static localization:UI.ButtonLabel_Stop}" />
            </Button>
        </StackPanel>
    </Grid>
</Window>