<!--
// /***************************************************************************
// Aaru Data Preservation Suite
// ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
//
// Filename       : ImageInfo.xaml
// Author(s)      : Natalia Portillo <claunia@claunia.com>
//
// Component      : GUI panel.
//
// ‐‐[ Description ] ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
//
//     Image information panel.
//
// ‐‐[ 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‐2020 Natalia Portillo
// ****************************************************************************/
-->
<UserControl 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:panels="clr-namespace:Aaru.Gui.ViewModels.Panels"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="Aaru.Gui.Views.Panels.ImageInfo">
    <Design.DataContext>
        <panels:ImageInfoViewModel />
    </Design.DataContext>
    <StackPanel>
        <Image Width="128" Height="128" HorizontalAlignment="Center" VerticalAlignment="Center"
               Source="{Binding MediaLogo}" />
        <TextBlock Text="Image information" FontWeight="Bold" />
        <TextBlock Text="{Binding ImagePathText}" /> <TextBlock Text="{Binding FilterText}" />
        <TextBlock Text="{Binding ImageIdentifiedText}" />
        <TabControl>
            <TabItem>
                <TabItem.Header>
                    <TextBlock Text="General" />
                </TabItem.Header>
                <StackPanel>
                    <TextBlock Text="{Binding ImageFormatText}" IsVisible="{Binding !!ImageFormatText}" />
                    <TextBlock Text="{Binding ApplicationText}" IsVisible="{Binding !!ApplicationText}" />
                    <TextBlock Text="{Binding ImageSizeText}" IsVisible="{Binding !!ImageSizeText}" />
                    <TextBlock Text="{Binding SectorsText}" IsVisible="{Binding !!SectorsText}" />
                    <TextBlock Text="{Binding CreatorText}" IsVisible="{Binding !!CreatorText}" />
                    <TextBlock Text="{Binding CreationTimeText}" IsVisible="{Binding !!CreationTimeText}" />
                    <TextBlock Text="{Binding LastModificationTimeText}"
                               IsVisible="{Binding !!LastModificationTimeText}" />
                    <TextBlock Text="{Binding MediaTypeText}" IsVisible="{Binding !!MediaTypeText}" />
                    <TextBlock Text="{Binding HasPartitionsText}" IsVisible="{Binding !!HasPartitionsText}" />
                    <TextBlock Text="{Binding HasSessionsText}" IsVisible="{Binding !!HasSessionsText}" />
                    <TextBlock Text="Comments:" IsVisible="{Binding !!CommentsText}" FontWeight="Bold" />
                    <TextBox IsReadOnly="True" TextWrapping="Wrap" Text="{Binding CommentsText}"
                             IsVisible="{Binding !!CommentsText}" />
                    <TextBlock Text="Media information" FontWeight="Bold" IsVisible="{Binding MediaInformationVisible}" />
                    <TextBlock Text="{Binding MediaSequenceText}" IsVisible="{Binding !!MediaSequenceText}" />
                    <TextBlock Text="{Binding MediaTitleText}" IsVisible="{Binding !!MediaTitleText}" />
                    <TextBlock Text="{Binding MediaManufacturerText}" IsVisible="{Binding !!MediaManufacturerText}" />
                    <TextBlock Text="{Binding MediaModelText}" IsVisible="{Binding !!MediaModelText}" />
                    <TextBlock Text="{Binding MediaSerialNumberText}" IsVisible="{Binding !!MediaSerialNumberText}" />
                    <TextBlock Text="{Binding MediaBarcodeText}" IsVisible="{Binding !!MediaBarcodeText}" />
                    <TextBlock Text="{Binding MediaPartNumberText}" IsVisible="{Binding !!MediaPartNumberText}" />
                    <TextBlock Text="Drive information" FontWeight="Bold" IsVisible="{Binding DriveInformationVisible}" />
                    <TextBlock Text="{Binding DriveManufacturerText}" IsVisible="{Binding !!DriveManufacturerText}" />
                    <TextBlock Text="{Binding DriveModelText}" IsVisible="{Binding !!DriveModelText}" />
                    <TextBlock Text="{Binding DriveSerialNumberText}" IsVisible="{Binding !!DriveSerialNumberText}" />
                    <TextBlock Text="{Binding DriveFirmwareRevisionText}"
                               IsVisible="{Binding !!DriveFirmwareRevisionText}" />
                    <TextBlock Text="{Binding MediaGeometryText}" IsVisible="{Binding !!MediaGeometryText}" />
                    <TextBlock Text="Readable media tags" FontWeight="Bold" IsVisible="{Binding !!MediaTagsList.Count}" />
                    <DataGrid Items="{Binding MediaTagsList}" IsVisible="{Binding !!MediaTagsList.Count}"
                              IsReadOnly="True">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Tag" Binding="{Binding .}" Width="Auto" IsReadOnly="True" />
                        </DataGrid.Columns>
                    </DataGrid>
                    <TextBlock Text="Readable sector tags" FontWeight="Bold"
                               IsVisible="{Binding !!SectorTagsList.Count}" />
                    <DataGrid Items="{Binding SectorTagsList}" IsVisible="{Binding !!SectorTagsList.Count}"
                              IsReadOnly="True">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Tag" Binding="{Binding .}" Width="Auto" IsReadOnly="True" />
                        </DataGrid.Columns>
                    </DataGrid>
                </StackPanel>
            </TabItem>
            <TabItem IsVisible="{Binding !!Sessions.Count}">
                <TabItem.Header>
                    <TextBlock Text="Sessions" />
                </TabItem.Header>
                <DataGrid Items="{Binding Sessions}" IsVisible="{Binding !!Sessions.Count}" IsReadOnly="True">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Session" Binding="{Binding SessionSequence}" Width="Auto" />
                        <DataGridTextColumn Header="First track" Binding="{Binding StartTrack}" Width="Auto" />
                        <DataGridTextColumn Header="Last track" Binding="{Binding EndTrack}" Width="Auto" />
                        <DataGridTextColumn Header="Start" Binding="{Binding StartSector}" Width="Auto" />
                        <DataGridTextColumn Header="End" Binding="{Binding EndSector}" Width="Auto" />
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem IsVisible="{Binding !!Tracks.Count}">
                <TabItem.Header>
                    <TextBlock Text="Tracks" />
                </TabItem.Header>
                <DataGrid Items="{Binding Tracks}" IsVisible="{Binding !!Tracks.Count}" IsReadOnly="True">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Track" Binding="{Binding TrackSequence}" Width="Auto" />
                        <DataGridTextColumn Header="Type" Binding="{Binding TrackType}" Width="Auto" />
                        <DataGridTextColumn Header="Bps" Binding="{Binding TrackBytesPerSector}" Width="Auto" />
                        <DataGridTextColumn Header="Raw bps" Binding="{Binding TrackRawBytesPerSector}" Width="Auto" />
                        <DataGridTextColumn Header="Subchannel" Binding="{Binding TrackSubchannelType}" Width="Auto" />
                        <DataGridTextColumn Header="Pregap" Binding="{Binding TrackPregap}" Width="Auto" />
                        <DataGridTextColumn Header="Start" Binding="{Binding TrackStartSector}" Width="Auto" />
                        <DataGridTextColumn Header="End" Binding="{Binding TrackEndSector}" Width="Auto" />
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem IsVisible="{Binding !!DumpHardwareList.Count}">
                <TabItem.Header>
                    <TextBlock Text="Dump hardware" />
                </TabItem.Header>
                <DataGrid Items="{Binding DumpHardwareList}" IsVisible="{Binding !!DumpHardwareList.Count}"
                          IsReadOnly="True">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Manufacturer" Binding="{Binding Manufacturer}" Width="Auto" />
                        <DataGridTextColumn Header="Model" Binding="{Binding Model}" Width="Auto" />
                        <DataGridTextColumn Header="Revision" Binding="{Binding Revision}" Width="Auto" />
                        <DataGridTextColumn Header="Serial" Binding="{Binding Serial}" Width="Auto" />
                        <DataGridTextColumn Header="Software" Binding="{Binding SoftwareName}" Width="Auto" />
                        <DataGridTextColumn Header="Version" Binding="{Binding SoftwareVersion}" Width="Auto" />
                        <DataGridTextColumn Header="Operating system" Binding="{Binding OperatingSystem}" Width="Auto" />
                        <DataGridTextColumn Header="Start" Binding="{Binding TrackStartSector}" Width="Auto" />
                        <DataGridTextColumn Header="End" Binding="{Binding TrackEndSector}" Width="Auto" />
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem IsVisible="{Binding !!ScsiInfo}">
                <TabItem.Header>
                    <TextBlock Text="SCSI" />
                </TabItem.Header>
                <ContentControl Content="{Binding ScsiInfo}" />
            </TabItem>
            <TabItem IsVisible="{Binding !!AtaInfo}">
                <TabItem.Header>
                    <TextBlock Text="ATA / ATAPI" />
                </TabItem.Header>
                <ContentControl Content="{Binding AtaInfo}" />
            </TabItem>
            <TabItem IsVisible="{Binding !!CompactDiscInfo}">
                <TabItem.Header>
                    <TextBlock Text="CompactDisc" />
                </TabItem.Header>
                <ContentControl Content="{Binding CompactDiscInfo}" />
            </TabItem>
            <TabItem IsVisible="{Binding !!DvdInfo}">
                <TabItem.Header>
                    <TextBlock Text="DVD / HD DVD" />
                </TabItem.Header>
                <ContentControl Content="{Binding DvdInfo}" />
            </TabItem>
            <TabItem IsVisible="{Binding !!DvdWritableInfo}">
                <TabItem.Header>
                    <TextBlock Text="DVD-R(W)" />
                </TabItem.Header>
                <ContentControl Content="{Binding DvdWritableInfo}" />
            </TabItem>
            <TabItem IsVisible="{Binding !!BlurayInfo}">
                <TabItem.Header>
                    <TextBlock Text="Blu-ray" />
                </TabItem.Header>
                <ContentControl Content="{Binding BlurayInfo}" />
            </TabItem>
            <TabItem IsVisible="{Binding !!PcmciaInfo}">
                <TabItem.Header>
                    <TextBlock Text="PCMCIA" />
                </TabItem.Header>
                <ContentControl Content="{Binding PcmciaInfo}" />
            </TabItem>
            <TabItem IsVisible="{Binding !!SdMmcInfo}">
                <TabItem.Header>
                    <TextBlock Text="SD / MMC" />
                </TabItem.Header>
                <ContentControl Content="{Binding SdMmcInfo}" />
            </TabItem>
            <TabItem IsVisible="{Binding !!XboxInfo}">
                <TabItem.Header>
                    <TextBlock Text="Xbox" />
                </TabItem.Header>
                <ContentControl Content="{Binding XboxInfo}" />
            </TabItem>
        </TabControl>
        <StackPanel Orientation="Horizontal" Spacing="5">
            <Button Command="{Binding EntropyCommand}">
                <TextBlock Text="Calculate entropy" />
            </Button>
            <Button Command="{Binding VerifyCommand}">
                <TextBlock Text="Verify" />
            </Button>
            <Button Command="{Binding ChecksumCommand}">
                <TextBlock Text="Checksum" />
            </Button>
            <Button Command="{Binding ConvertCommand}">
                <TextBlock Text="Convert to..." />
            </Button>
            <Button Command="{Binding CreateSidecarCommand}">
                <TextBlock Text="Create CICM XML sidecar..." />
            </Button>
            <Button Command="{Binding ViewSectorsCommand}">
                <TextBlock Text="View sectors" />
            </Button>
            <Button Command="{Binding DecodeMediaTagCommand}">
                <TextBlock Text="Decode media tags" />
            </Button>
        </StackPanel>
    </StackPanel>
</UserControl>