<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: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="680"
        Height="600"
        x:Class="Aaru.Gui.Views.Windows.ImageMetadata"
        x:DataType="windows:ImageMetadataViewModel"
        Title="{x:Static localization:UI.Title_Edit_image_metadata}">
    <Design.DataContext>
        <windows:ImageMetadataViewModel />
    </Design.DataContext>
    <Grid RowDefinitions="*, Auto"
          RowSpacing="8"
          Margin="12">
        <ScrollViewer Grid.Row="0"
                      HorizontalScrollBarVisibility="Disabled"
                      VerticalScrollBarVisibility="Auto">
            <TabControl>
                <TabItem>
                    <TabItem.Header>
                        <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Image}" />
                    </TabItem.Header>
                    <Grid Margin="8"
                          RowSpacing="8"
                          RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,*">
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8"
                                    Grid.Row="0">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Image_path}"
                                                       FontWeight="Bold" />
                            <controls:SpectreTextBlock Text="{Binding ImagePath, Mode=OneWay}" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8"
                                    Grid.Row="1">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Media_type}"
                                                       FontWeight="Bold" />
                            <controls:SpectreTextBlock Text="{Binding MediaType, Mode=OneWay}" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8"
                                    Grid.Row="2">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Size}"
                                                       FontWeight="Bold" />
                            <controls:SpectreTextBlock Text="{Binding Size, Mode=OneWay}" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8"
                                    Grid.Row="3">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Creator}"
                                                       FontWeight="Bold"
                                                       VerticalAlignment="Center" />
                            <CheckBox Content="{x:Static localization:UI.Title_Not_set}"
                                      IsChecked="{Binding CreatorNotSet, Mode=TwoWay}" />
                        </StackPanel>
                        <TextBox Text="{Binding Creator, Mode=TwoWay}"
                                 Watermark="{x:Static localization:UI.Watermark_Who_created_the_image}"
                                 Grid.Row="4"
                                 IsEnabled="{Binding !CreatorNotSet, Mode=OneWay}" />
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8"
                                    Grid.Row="5">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Comments}"
                                                       FontWeight="Bold"
                                                       VerticalAlignment="Center" />
                            <CheckBox Content="{x:Static localization:UI.Title_Not_set}"
                                      IsChecked="{Binding CommentsNotSet, Mode=TwoWay}" />
                        </StackPanel>
                        <TextBox Text="{Binding Comments, Mode=TwoWay}"
                                 AcceptsReturn="True"
                                 MinHeight="200"
                                 VerticalAlignment="Stretch"
                                 Grid.Row="6"
                                 IsEnabled="{Binding !CommentsNotSet, Mode=OneWay}" />
                    </Grid>
                </TabItem>
                <TabItem>
                    <TabItem.Header>
                        <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Media}" />
                    </TabItem.Header>
                    <StackPanel Orientation="Vertical"
                                Margin="8"
                                Spacing="8">
                        <CheckBox Content="{x:Static localization:UI.Title_Sequence_is_not_set}"
                                  IsChecked="{Binding SequenceNotSet, Mode=TwoWay}" />
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Media_number_no}"
                                                       VerticalAlignment="Center" />
                            <NumericUpDown Minimum="1"
                                           Increment="1"
                                           Value="{Binding MediaSequence, Mode=TwoWay}"
                                           IsEnabled="{Binding !SequenceNotSet, Mode=OneWay}"
                                           Width="120" />
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_no_in_a_sequence_of_no}"
                                                       VerticalAlignment="Center" />
                            <NumericUpDown Minimum="1"
                                           Increment="1"
                                           Value="{Binding MediaLastSequence, Mode=TwoWay}"
                                           IsEnabled="{Binding !SequenceNotSet, Mode=OneWay}"
                                           Width="120" />
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_no_media}"
                                                       VerticalAlignment="Center" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Title}"
                                                       FontWeight="Bold"
                                                       VerticalAlignment="Center" />
                            <CheckBox Content="{x:Static localization:UI.Title_Not_set}"
                                      IsChecked="{Binding MediaTitleNotSet, Mode=TwoWay}" />
                        </StackPanel>
                        <TextBox Text="{Binding MediaTitle, Mode=TwoWay}"
                                 IsEnabled="{Binding !MediaTitleNotSet, Mode=OneWay}"
                                 Watermark="{x:Static localization:UI.Watermark_Media_title}" />
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Manufacturer}"
                                                       FontWeight="Bold"
                                                       VerticalAlignment="Center" />
                            <CheckBox Content="{x:Static localization:UI.Title_Not_set}"
                                      IsChecked="{Binding MediaManufacturerNotSet, Mode=TwoWay}" />
                        </StackPanel>
                        <TextBox Text="{Binding MediaManufacturer, Mode=TwoWay}"
                                 IsEnabled="{Binding !MediaManufacturerNotSet, Mode=OneWay}"
                                 Watermark="{x:Static localization:UI.Watermark_Media_manufacturer}" />
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Model}"
                                                       FontWeight="Bold"
                                                       VerticalAlignment="Center" />
                            <CheckBox Content="{x:Static localization:UI.Title_Not_set}"
                                      IsChecked="{Binding MediaModelNotSet, Mode=TwoWay}" />
                        </StackPanel>
                        <TextBox Text="{Binding MediaModel, Mode=TwoWay}"
                                 IsEnabled="{Binding !MediaModelNotSet, Mode=OneWay}"
                                 Watermark="{x:Static localization:UI.Watermark_Media_model}" />
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Serial_number}"
                                                       FontWeight="Bold"
                                                       VerticalAlignment="Center" />
                            <CheckBox Content="{x:Static localization:UI.Title_Not_set}"
                                      IsChecked="{Binding MediaSerialNumberNotSet, Mode=TwoWay}" />
                        </StackPanel>
                        <TextBox Text="{Binding MediaSerialNumber, Mode=TwoWay}"
                                 IsEnabled="{Binding !MediaSerialNumberNotSet, Mode=OneWay}"
                                 Watermark="{x:Static localization:UI.Watermark_Media_serial_number}" />
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Part_number}"
                                                       FontWeight="Bold"
                                                       VerticalAlignment="Center" />
                            <CheckBox Content="{x:Static localization:UI.Title_Not_set}"
                                      IsChecked="{Binding MediaPartNumberNotSet, Mode=TwoWay}" />
                        </StackPanel>
                        <TextBox Text="{Binding MediaPartNumber, Mode=TwoWay}"
                                 IsEnabled="{Binding !MediaPartNumberNotSet, Mode=OneWay}"
                                 Watermark="{x:Static localization:UI.Watermark_Media_part_number}" />
                    </StackPanel>
                </TabItem>
                <TabItem>
                    <TabItem.Header>
                        <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Drive}" />
                    </TabItem.Header>
                    <StackPanel Orientation="Vertical"
                                Margin="8"
                                Spacing="8">
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Manufacturer}"
                                                       FontWeight="Bold"
                                                       VerticalAlignment="Center" />
                            <CheckBox Content="{x:Static localization:UI.Title_Not_set}"
                                      IsChecked="{Binding DriveManufacturerNotSet, Mode=TwoWay}" />
                        </StackPanel>
                        <TextBox Text="{Binding DriveManufacturer, Mode=TwoWay}"
                                 IsEnabled="{Binding !DriveManufacturerNotSet, Mode=OneWay}"
                                 Watermark="{x:Static localization:UI.Watermark_Drive_manufacturer}" />
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Model}"
                                                       FontWeight="Bold"
                                                       VerticalAlignment="Center" />
                            <CheckBox Content="{x:Static localization:UI.Title_Not_set}"
                                      IsChecked="{Binding DriveModelNotSet, Mode=TwoWay}" />
                        </StackPanel>
                        <TextBox Text="{Binding DriveModel, Mode=TwoWay}"
                                 IsEnabled="{Binding !DriveModelNotSet, Mode=OneWay}"
                                 Watermark="{x:Static localization:UI.Watermark_Drive_model}" />
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Serial_number}"
                                                       FontWeight="Bold"
                                                       VerticalAlignment="Center" />
                            <CheckBox Content="{x:Static localization:UI.Title_Not_set}"
                                      IsChecked="{Binding DriveSerialNumberNotSet, Mode=TwoWay}" />
                        </StackPanel>
                        <TextBox Text="{Binding DriveSerialNumber, Mode=TwoWay}"
                                 IsEnabled="{Binding !DriveSerialNumberNotSet, Mode=OneWay}"
                                 Watermark="{x:Static localization:UI.Watermark_Drive_serial_number}" />
                        <StackPanel Orientation="Horizontal"
                                    Spacing="8">
                            <controls:SpectreTextBlock Text="{x:Static localization:UI.Title_Firmware_revision}"
                                                       FontWeight="Bold"
                                                       VerticalAlignment="Center" />
                            <CheckBox Content="{x:Static localization:UI.Title_Not_set}"
                                      IsChecked="{Binding DriveFirmwareRevisionNotSet, Mode=TwoWay}" />
                        </StackPanel>
                        <TextBox Text="{Binding DriveFirmwareRevision, Mode=TwoWay}"
                                 IsEnabled="{Binding !DriveFirmwareRevisionNotSet, Mode=OneWay}"
                                 Watermark="{x:Static localization:UI.Watermark_Drive_firmware_revision}" />
                    </StackPanel>
                </TabItem>
            </TabControl>
        </ScrollViewer>
        <StackPanel Grid.Row="1"
                    HorizontalAlignment="Right"
                    Orientation="Horizontal"
                    Spacing="8">
            <Button Content="{x:Static localization:UI.ButtonLabel_Open}"
                    IsVisible="{Binding !IsOpened, Mode=OneWay}"
                    Command="{Binding OpenImageCommand, Mode=OneWay}" />
            <Button Content="{x:Static localization:UI.ButtonLabel_Load}"
                    IsVisible="{Binding IsOpened, Mode=OneWay}"
                    Command="{Binding LoadMetadataCommand, Mode=OneWay}" />
            <Button Content="{x:Static localization:UI.ButtonLabel_Save}"
                    IsVisible="{Binding IsOpened, Mode=OneWay}"
                    Command="{Binding SaveMetadataCommand, Mode=OneWay}" />
            <Button Content="{x:Static localization:UI.ButtonLabel_Close}"
                    Command="{Binding CloseCommand, Mode=OneWay}" />
        </StackPanel>
    </Grid>
</Window>