<!--
// /***************************************************************************
// RomRepoMgr - ROM repository manager
// ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
//
// Author(s)      : Natalia Portillo <claunia@claunia.com>
//
// ‐‐[ 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 © 2020-2024 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:vm="clr-namespace:RomRepoMgr.ViewModels;assembly=RomRepoMgr"
        xmlns:resources="clr-namespace:RomRepoMgr.Resources"
        mc:Ignorable="d"
        Width="600"
        Height="400"
        x:Class="RomRepoMgr.Views.About"
        Icon="/Assets/avalonia-logo.ico"
        CanResize="False"
        Title="{x:Static resources:Localization.AboutTitle}">
    <Design.DataContext>
        <vm:AboutViewModel />
    </Design.DataContext>
    <Grid RowDefinitions="Auto,*,Auto"
          Margin="16"
          RowSpacing="8">
        <Grid Grid.Row="0"
              ColumnSpacing="8"
              ColumnDefinitions="Auto,*">
            <Image Source="/Assets/avalonia-logo.ico"
                   Width="48"
                   Height="48" />
            <Grid Grid.Column="1"
                  HorizontalAlignment="Left"
                  VerticalAlignment="Center"
                  RowDefinitions="Auto,Auto"
                  RowSpacing="8">
                <TextBlock Grid.Row="0"
                           Text="{Binding SoftwareName, Mode=OneWay}"
                           HorizontalAlignment="Left"
                           VerticalAlignment="Center"
                           FontSize="16"
                           FontWeight="Bold" />
                <TextBlock Grid.Row="1"
                           Text="{Binding VersionText, Mode=OneWay}"
                           HorizontalAlignment="Left"
                           VerticalAlignment="Center" />
            </Grid>
        </Grid>
        <TabControl Grid.Row="1"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch">
            <TabItem>
                <TabItem.Header>
                    <TextBlock Text="{x:Static resources:Localization.AboutLabel}" />
                </TabItem.Header>
                <Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,*"
                      RowSpacing="8">
                    <TextBlock Grid.Row="0"
                               Text="{Binding SuiteName, Mode=OneWay}" />
                    <TextBlock Grid.Row="1"
                               Text="{Binding Copyright, Mode=OneWay}" />
                    <Button Grid.Row="2"
                            Background="Transparent"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            Padding="0"
                            BorderThickness="0"
                            Command="{Binding WebsiteCommand, Mode=OneWay}">
                        <TextBlock Text="{Binding Website, Mode=OneWay}"
                                   Foreground="Blue"
                                   TextDecorations="Underline" />
                    </Button>
                    <Button Grid.Row="3"
                            Background="Transparent"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            Padding="0"
                            BorderThickness="0"
                            Command="{Binding LicenseCommand, Mode=OneWay}">
                        <TextBlock Text="{x:Static resources:Localization.LicenseLabel}"
                                   Foreground="Blue"
                                   TextDecorations="Underline" />
                    </Button>
                </Grid>
            </TabItem>
            <TabItem>
                <TabItem.Header>
                    <TextBlock Text="{x:Static resources:Localization.LibrariesLabel}" />
                </TabItem.Header>
                <DataGrid ItemsSource="{Binding Assemblies, Mode=OneWay}"
                          HorizontalScrollBarVisibility="Visible">
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Name, Mode=OneWay}"
                                            Width="Auto"
                                            IsReadOnly="True">
                            <DataGridTextColumn.Header>
                                <TextBlock Text="{x:Static resources:Localization.AssembliesLibraryText}" />
                            </DataGridTextColumn.Header>
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Version, Mode=OneWay}"
                                            Width="Auto"
                                            IsReadOnly="True">
                            <DataGridTextColumn.Header>
                                <TextBlock Text="{x:Static resources:Localization.AssembliesVersionText}" />
                            </DataGridTextColumn.Header>
                        </DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </TabItem>
            <TabItem>
                <TabItem.Header>
                    <TextBlock Text="{x:Static resources:Localization.AuthorsLabel}" />
                </TabItem.Header>
                <TextBox IsReadOnly="True"
                         Text="{x:Static resources:Localization.AuthorsText}" />
            </TabItem>
        </TabControl>
        <Button Grid.Row="2"
                HorizontalAlignment="Right"
                VerticalAlignment="Center"
                Command="{Binding CloseCommand, Mode=OneWay}">
            <TextBlock Text="{x:Static resources:Localization.CloseLabel}" />
        </Button>
    </Grid>
</Window>