<!--
// /***************************************************************************
// Aaru Data Preservation Suite
// ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
//
// Filename       : CompactDiscInfo.xaml
// Author(s)      : Natalia Portillo <claunia@claunia.com>
//
// Component      : GUI tabs.
//
// ‐‐[ Description ] ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
//
//     Compact Disc tab.
//
// ‐‐[ 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
// ****************************************************************************/
-->
<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:tabs="clr-namespace:Aaru.Gui.ViewModels.Tabs"
             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"
             x:DataType="tabs:CompactDiscInfoViewModel"
             x:Class="Aaru.Gui.Views.Tabs.CompactDiscInfo">
    <Design.DataContext>
        <tabs:CompactDiscInfoViewModel />
    </Design.DataContext>
    <UserControl.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>
    </UserControl.Styles>
    <TabControl>
        <TabItem IsVisible="False">
            <TabItem.Header>
                <TextBlock Text="Landing placeholder" />
            </TabItem.Header>
        </TabItem>
        <TabItem IsVisible="{Binding !!CdInformationText, Mode=OneWay}">
            <TabItem.Header>
                <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Information}" />
            </TabItem.Header>
            <Grid RowDefinitions="*, Auto"
                  Margin="8"
                  RowSpacing="8">
                <Border Grid.Row="0"
                        BorderThickness="1"
                        BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
                        CornerRadius="8">
                    <ScrollViewer Padding="8">
                        <controls:SpectreTextBlock TextWrapping="Wrap"
                                                   Text="{Binding CdInformationText, Mode=OneWay}" />
                    </ScrollViewer>
                </Border>
                <Button Grid.Row="1"
                        Command="{Binding SaveCdInformationCommand, Mode=OneWay}"
                        VerticalAlignment="Bottom"
                        HorizontalAlignment="Left">
                    <TextBlock Text="{x:Static localization:UI.ButtonLabel_Save_READ_DISC_INFORMATION_response}" />
                </Button>
            </Grid>
        </TabItem>
        <TabItem IsVisible="{Binding !!CdTocText, Mode=OneWay}">
            <TabItem.Header>
                <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_TOC}" />
            </TabItem.Header>
            <Grid RowDefinitions="*, Auto"
                  Margin="8"
                  RowSpacing="8">
                <Border Grid.Row="0"
                        BorderThickness="1"
                        BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
                        CornerRadius="8">
                    <ScrollViewer Padding="8">
                        <controls:SpectreTextBlock TextWrapping="Wrap"
                                                   Text="{Binding CdTocText, Mode=OneWay}" />
                    </ScrollViewer>
                </Border>
                <Button Grid.Row="1"
                        Command="{Binding SaveCdTocCommand, Mode=OneWay}">
                    <TextBlock Text="{x:Static localization:UI.ButtonLabel_Save_READ_TOC_response}" />
                </Button>
            </Grid>
        </TabItem>
        <TabItem IsVisible="{Binding !!CdFullTocText, Mode=OneWay}">
            <TabItem.Header>
                <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_TOC_full}" />
            </TabItem.Header>
            <Grid RowDefinitions="*, Auto"
                  Margin="8"
                  RowSpacing="8">
                <Border Grid.Row="0"
                        BorderThickness="1"
                        BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
                        CornerRadius="8">
                    <ScrollViewer Padding="8">
                        <controls:SpectreTextBlock TextWrapping="Wrap"
                                                   Text="{Binding CdFullTocText, Mode=OneWay}" />
                    </ScrollViewer>
                </Border>
                <Button Grid.Row="1"
                        Command="{Binding SaveCdFullTocCommand, Mode=OneWay}">
                    <TextBlock Text="{x:Static localization:UI.ButtonLabel_Save_READ_RAW_TOC_response}" />
                </Button>
            </Grid>
        </TabItem>
        <TabItem IsVisible="{Binding !!CdSessionText, Mode=OneWay}">
            <TabItem.Header>
                <controls:SpectreTextBlock Text="{x:Static localization:Core.Title_Session}" />
            </TabItem.Header>
            <Grid RowDefinitions="*, Auto"
                  Margin="8"
                  RowSpacing="8">
                <Border Grid.Row="0"
                        BorderThickness="1"
                        BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
                        CornerRadius="8">
                    <ScrollViewer Padding="8">
                        <controls:SpectreTextBlock TextWrapping="Wrap"
                                                   Text="{Binding CdSessionText, Mode=OneWay}" />
                    </ScrollViewer>
                </Border>
                <Button Grid.Row="1"
                        Command="{Binding SaveCdSessionCommand, Mode=OneWay}">
                    <TextBlock Text="{x:Static localization:UI.ButtonLabel_Save_READ_SESSION_response}" />
                </Button>
            </Grid>
        </TabItem>
        <TabItem IsVisible="{Binding !!CdTextText, Mode=OneWay}">
            <TabItem.Header>
                <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_CD_TEXT}" />
            </TabItem.Header>
            <Grid RowDefinitions="*, Auto"
                  Margin="8"
                  RowSpacing="8">
                <Border Grid.Row="0"
                        BorderThickness="1"
                        BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
                        CornerRadius="8">
                    <ScrollViewer Padding="8">
                        <controls:SpectreTextBlock TextWrapping="Wrap"
                                                   Text="{Binding CdTextText, Mode=OneWay}" />
                    </ScrollViewer>
                </Border>
                <Button Grid.Row="1"
                        Command="{Binding SaveCdTextCommand, Mode=OneWay}">
                    <TextBlock Text="{x:Static localization:UI.ButtonLabel_Save_Lead_In_CD_TEXT}" />
                </Button>
            </Grid>
        </TabItem>
        <TabItem IsVisible="{Binding !!CdAtipText, Mode=OneWay}">
            <TabItem.Header>
                <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_ATIP}" />
            </TabItem.Header>
            <Grid RowDefinitions="*, Auto"
                  Margin="8"
                  RowSpacing="8">
                <Border Grid.Row="0"
                        BorderThickness="1"
                        BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
                        CornerRadius="8">
                    <ScrollViewer Padding="8">
                        <controls:SpectreTextBlock TextWrapping="Wrap"
                                                   Text="{Binding CdAtipText, Mode=OneWay}" />
                    </ScrollViewer>
                </Border>
                <Button Grid.Row="1"
                        Command="{Binding SaveCdAtipCommand, Mode=OneWay}">
                    <TextBlock Text="{x:Static localization:UI.ButtonLabel_Save_READ_ATIP_response}" />
                </Button>
            </Grid>
        </TabItem>
        <TabItem IsVisible="{Binding MiscellaneousVisible, Mode=OneWay}">
            <TabItem.Header>
                <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Miscellaneous}" />
            </TabItem.Header>
            <Grid RowDefinitions="Auto, *, Auto"
                  Margin="8"
                  RowSpacing="8">
                <Grid ColumnDefinitions="Auto, *"
                      Grid.Row="0"
                      IsVisible="{Binding !!McnText, Mode=OneWay}"
                      ColumnSpacing="8">
                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Media_catalog_number}"
                                               VerticalAlignment="Center"
                                               Grid.Column="0" />
                    <TextBox Grid.Column="1"
                             IsReadOnly="True"
                             VerticalAlignment="Center"
                             HorizontalAlignment="Stretch"
                             Text="{Binding McnText, Mode=OneWay}"
                             Background="Transparent"
                             BorderThickness="0"
                             Cursor="Arrow"
                             Padding="0" />
                </Grid>
                <Grid Grid.Row="1"
                      IsVisible="{Binding !!IsrcList.Count, Mode=OneWay}"
                      RowDefinitions="Auto, *"
                      RowSpacing="8">
                    <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_ISRCs}"
                                               Grid.Row="0" />
                    <DataGrid ItemsSource="{Binding IsrcList, Mode=OneWay}"
                              Grid.Row="1"
                              AutoGenerateColumns="False"
                              IsReadOnly="True">
                        <DataGrid.Columns>
                            <DataGridTemplateColumn Header="{x:Static localization:Core.Title_Track}"
                                                    Width="Auto">
                                <DataGridTemplateColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <controls:SpectreTextBlock Text="{x:Static localization:Core.Title_Track}" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.HeaderTemplate>
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <controls:SpectreTextBlock Text="{Binding Track, Mode=OneWay}" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                            <DataGridTemplateColumn Header="{x:Static localization:UI.Title_ISRC}"
                                                    Width="*">
                                <DataGridTemplateColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_ISRC}" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.HeaderTemplate>
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <controls:SpectreTextBlock Text="{Binding Isrc, Mode=OneWay}" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
                <Button Grid.Row="2"
                        Command="{Binding SaveCdPmaCommand, Mode=OneWay}"
                        IsVisible="{Binding CdPmaVisible, Mode=OneWay}">
                    <TextBlock Text="{x:Static localization:UI.ButtonLabel_Save_READ_PMA_response}" />
                </Button>
            </Grid>
        </TabItem>
    </TabControl>
</UserControl>