<!--
// /***************************************************************************
// Aaru Data Preservation Suite
// ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
//
// Filename       : StatisticsDialog.xaml
// Author(s)      : Natalia Portillo <claunia@claunia.com>
//
// Component      : GUI dialogs.
//
// ‐‐[ Description ] ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
//
//     Statistics dialog.
//
// ‐‐[ 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:dialogs="clr-namespace:Aaru.Gui.ViewModels.Dialogs"
        xmlns:controls="clr-namespace:Aaru.Gui.Controls"
        xmlns:localization="clr-namespace:Aaru.Localization;assembly=Aaru.Localization"
        mc:Ignorable="d"
        d:DesignWidth="800"
        d:DesignHeight="450"
        Width="550"
        Height="320"
        x:Class="Aaru.Gui.Views.Dialogs.StatisticsDialog"
        Icon="/Assets/aaru.png"
        CanResize="False"
        x:DataType="dialogs:StatisticsViewModel"
        Title="{x:Static localization:UI.Title_Statistics}">
    <Design.DataContext>
        <dialogs:StatisticsViewModel />
    </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 Margin="12"
          RowSpacing="8"
          RowDefinitions="*,Auto">
        <TabControl Grid.Row="0"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch">
            <TabItem IsVisible="{Binding CommandsVisible, Mode=OneWay}">
                <TabItem.Header>
                    <TextBlock Text="{x:Static localization:UI.Title_Commands}" />
                </TabItem.Header>
                <ScrollViewer HorizontalScrollBarVisibility="Disabled"
                              VerticalScrollBarVisibility="Auto">
                    <StackPanel VerticalAlignment="Top"
                                HorizontalAlignment="Stretch"
                                Spacing="8"
                                Margin="8">
                        <TextBlock Text="{Binding FsInfoText, Mode=OneWay}"
                                   IsVisible="{Binding FsInfoVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding ChecksumText, Mode=OneWay}"
                                   IsVisible="{Binding ChecksumVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding CompareText, Mode=OneWay}"
                                   IsVisible="{Binding CompareVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding ConvertImageText, Mode=OneWay}"
                                   IsVisible="{Binding ConvertImageVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding CreateSidecarText, Mode=OneWay}"
                                   IsVisible="{Binding CreateSidecarVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding DecodeText, Mode=OneWay}"
                                   IsVisible="{Binding DecodeVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding DeviceInfoText, Mode=OneWay}"
                                   IsVisible="{Binding DeviceInfoVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding DeviceReportText, Mode=OneWay}"
                                   IsVisible="{Binding DeviceReportVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding DumpMediaText, Mode=OneWay}"
                                   IsVisible="{Binding DumpMediaVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding EntropyText, Mode=OneWay}"
                                   IsVisible="{Binding EntropyVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding FormatsCommandText, Mode=OneWay}"
                                   IsVisible="{Binding FormatsCommandVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding ImageInfoText, Mode=OneWay}"
                                   IsVisible="{Binding ImageInfoVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding MediaInfoText, Mode=OneWay}"
                                   IsVisible="{Binding MediaInfoVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding MediaScanText, Mode=OneWay}"
                                   IsVisible="{Binding MediaScanVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding PrintHexText, Mode=OneWay}"
                                   IsVisible="{Binding PrintHexVisible, Mode=OneWay}" />
                        <TextBlock Text="{Binding VerifyText, Mode=OneWay}"
                                   IsVisible="{Binding VerifyVisible, Mode=OneWay}" />
                    </StackPanel>
                </ScrollViewer>
            </TabItem>
            <TabItem IsVisible="{Binding FiltersVisible, Mode=OneWay}">
                <TabItem.Header>
                    <TextBlock Text="{x:Static localization:UI.Title_Filters}" />
                </TabItem.Header>
                <DataGrid ItemsSource="{Binding Filters, Mode=OneWay}"
                          Margin="8"
                          HorizontalScrollBarVisibility="Visible">
                    <DataGrid.Columns>
                        <DataGridTemplateColumn Width="*">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Filter}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Name, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn Width="Auto">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Times_used}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Count, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem IsVisible="{Binding FormatsVisible, Mode=OneWay}">
                <TabItem.Header>
                    <TextBlock Text="{x:Static localization:UI.Title_Formats}" />
                </TabItem.Header>
                <DataGrid ItemsSource="{Binding Formats, Mode=OneWay}"
                          Margin="8"
                          HorizontalScrollBarVisibility="Visible">
                    <DataGrid.Columns>
                        <DataGridTemplateColumn Width="*">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Format}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Name, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn Width="Auto">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Times_used}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Count, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem IsVisible="{Binding PartitionsVisible, Mode=OneWay}">
                <TabItem.Header>
                    <TextBlock Text="{x:Static localization:UI.Title_Partitions}" />
                </TabItem.Header>
                <DataGrid ItemsSource="{Binding Partitions, Mode=OneWay}"
                          Margin="8"
                          HorizontalScrollBarVisibility="Visible">
                    <DataGrid.Columns>
                        <DataGridTemplateColumn Width="*">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Partition}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Name, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn Width="Auto">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Times_used}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Count, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem IsVisible="{Binding FilesystemsVisible, Mode=OneWay}">
                <TabItem.Header>
                    <TextBlock Text="{x:Static localization:UI.Title_Filesystems}" />
                </TabItem.Header>
                <DataGrid ItemsSource="{Binding Filesystems, Mode=OneWay}"
                          Margin="8"
                          HorizontalScrollBarVisibility="Visible">
                    <DataGrid.Columns>
                        <DataGridTemplateColumn Width="*">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Filesystem}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Name, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn Width="Auto">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Times_used}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Count, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem IsVisible="{Binding DevicesVisible, Mode=OneWay}">
                <TabItem.Header>
                    <TextBlock Text="{x:Static localization:UI.Title_Devices}" />
                </TabItem.Header>
                <DataGrid ItemsSource="{Binding Devices, Mode=OneWay}"
                          Margin="8"
                          HorizontalScrollBarVisibility="Visible">
                    <DataGrid.Columns>
                        <DataGridTemplateColumn Width="*">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Device}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Model, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn Width="Auto">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Manufacturer}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Manufacturer, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn Width="Auto">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Revision}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Revision, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn Width="Auto">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Bus}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Bus, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem IsVisible="{Binding MediasVisible, Mode=OneWay}">
                <TabItem.Header>
                    <TextBlock Text="{x:Static localization:UI.Title_Medias}" />
                </TabItem.Header>
                <DataGrid ItemsSource="{Binding Medias, Mode=OneWay}"
                          Margin="8"
                          HorizontalScrollBarVisibility="Visible">
                    <DataGrid.Columns>
                        <DataGridTemplateColumn Width="*">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Media}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Name, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn Width="Auto">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Times_used}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Count, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTemplateColumn Width="Auto">
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <controls:SpectreTextBlock Text="{x:Static localization:Core.Title_Type_for_media}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Type, Mode=OneWay}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
        </TabControl>
        <Button Grid.Row="1"
                HorizontalAlignment="Right"
                VerticalAlignment="Center"
                Command="{Binding CloseCommand, Mode=OneWay}">
            <TextBlock Text="{x:Static localization:UI.ButtonLabel_Close}" />
        </Button>
    </Grid>
</Window>