<!-- **************************************************************************

  Copyright (c) 2010 CubeSoft, Inc.

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero 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 Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.

*************************************************************************** -->
<Window
    x:Class="Cube.Pdf.App.Editor.MetadataWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:xb="clr-namespace:Cube.Xui.Behaviors;assembly=Cube.Xui"
    xmlns:my="clr-namespace:Cube.Pdf.App.Editor"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Title="{Binding Title.Text}"
    Height="540"
    Width="470"
    FontFamily="Meiryo UI"
    WindowStartupLocation="CenterOwner"
    ResizeMode="NoResize"
    ShowInTaskbar="False">

    <!-- **********************************************************************
      Resources
    *********************************************************************** -->
    <Window.Resources>
        <ResourceDictionary Source="pack://application:,,,/Themes/GenericDialog.xaml" />
    </Window.Resources>

    <!-- **********************************************************************
      Interaction
    *********************************************************************** -->
    <i:Interaction.Behaviors>
        <xb:CloseBehavior />
    </i:Interaction.Behaviors>

    <!-- **********************************************************************
      Main
    *********************************************************************** -->
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="60" />
        </Grid.RowDefinitions>

        <!-- ******************************************************************
          Summary
        ******************************************************************* -->
        <GroupBox
            Header="{Binding Summary.Text}"
            Margin="{StaticResource VerticalFirst}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="24" />
                    <RowDefinition Height="28" />
                    <RowDefinition Height="28" />
                    <RowDefinition Height="28" />
                    <RowDefinition Height="28" />
                </Grid.RowDefinitions>

                <!-- **********************************************************
                  Filename
                *********************************************************** -->
                <TextBlock
                    Text="{Binding Filename.Text}"
                    Grid.Row="0"
                    Grid.Column="0" />
                <TextBlock
                    Text="{Binding Filename.Value}"
                    Grid.Row="0"
                    Grid.Column="1" />

                <!-- **********************************************************
                  DocumentTitle
                *********************************************************** -->
                <TextBlock
                    Text="{Binding Document.Text}"
                    Grid.Row="1"
                    Grid.Column="0" />
                <TextBox
                    Text="{Binding Document.Value, Mode=TwoWay}"
                    Grid.Row="1"
                    Grid.Column="1" />

                <!-- **********************************************************
                  Author
                *********************************************************** -->
                <TextBlock
                    Text="{Binding Author.Text}"
                    Grid.Row="2"
                    Grid.Column="0" />
                <TextBox
                    Text="{Binding Author.Value, Mode=TwoWay}"
                    Grid.Row="2"
                    Grid.Column="1" />

                <!-- **********************************************************
                  Subject
                *********************************************************** -->
                <TextBlock
                    Text="{Binding Subject.Text}"
                    Grid.Row="3"
                    Grid.Column="0" />
                <TextBox
                    Text="{Binding Subject.Value, Mode=TwoWay}"
                    Grid.Row="3"
                    Grid.Column="1" />

                <!-- **********************************************************
                  Keywords
                *********************************************************** -->
                <TextBlock
                    Text="{Binding Keywords.Text}"
                    Grid.Row="4"
                    Grid.Column="0" />
                <TextBox
                    Text="{Binding Keywords.Value, Mode=TwoWay}"
                    Grid.Row="4"
                    Grid.Column="1" />
            </Grid>
        </GroupBox>

        <!-- ******************************************************************
          Details
        ******************************************************************* -->
        <GroupBox
            Header="{Binding Details.Text}"
            Margin="{StaticResource VerticalLast}"
            Grid.Row="1">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="28" />
                    <RowDefinition Height="28" />
                    <RowDefinition Height="28" />
                    <RowDefinition Height="24" />
                    <RowDefinition Height="24" />
                    <RowDefinition Height="24" />
                    <RowDefinition Height="24" />
                </Grid.RowDefinitions>

                <!-- **********************************************************
                  Version
                *********************************************************** -->
                <TextBlock
                    Text="{Binding Version.Text}"
                    Grid.Row="0"
                    Grid.Column="0" />
                <ComboBox
                    ItemsSource="{Binding Versions}"
                    SelectedValue="{Binding Version.Value, Mode=TwoWay}"
                    Grid.Row="0"
                    Grid.Column="1" />

                <!-- **********************************************************
                  ViewerPreferences
                *********************************************************** -->
                <TextBlock
                    Text="{Binding Viewer.Text}"
                    Grid.Row="1"
                    Grid.Column="0" />
                <ComboBox
                    ItemsSource="{Binding ViewerPreferences}"
                    SelectedValue="{Binding Viewer.Value, Mode=TwoWay}"
                    Grid.Row="1"
                    Grid.Column="1">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Converter={my:ViewerPreferencesConverter}}" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>

                <!-- **********************************************************
                  Creator
                *********************************************************** -->
                <TextBlock
                    Text="{Binding Creator.Text}"
                    Grid.Row="2"
                    Grid.Column="0" />
                <TextBox
                    Text="{Binding Creator.Value, Mode=TwoWay}"
                    Grid.Row="2"
                    Grid.Column="1" />

                <!-- **********************************************************
                  Producer
                *********************************************************** -->
                <TextBlock
                    Text="{Binding Producer.Text}"
                    Grid.Row="3"
                    Grid.Column="0" />
                <TextBlock
                    Text="{Binding Producer.Value}"
                    Grid.Row="3"
                    Grid.Column="1" />

                <!-- **********************************************************
                  Length (file size)
                *********************************************************** -->
                <TextBlock
                    Text="{Binding Length.Text}"
                    Grid.Row="4"
                    Grid.Column="0" />
                <TextBlock
                    Text="{Binding Length.Value, Converter={my:ByteConverter}}"
                    Grid.Row="4"
                    Grid.Column="1" />

                <!-- **********************************************************
                  CreationTime
                *********************************************************** -->
                <TextBlock
                    Text="{Binding CreationTime.Text}"
                    Grid.Row="5"
                    Grid.Column="0" />
                <TextBlock
                    Text="{Binding CreationTime.Value, StringFormat='yyyy/MM/dd HH:mm:ss'}"
                    Grid.Row="5"
                    Grid.Column="1" />

                <!-- **********************************************************
                  LastWriteTime
                *********************************************************** -->
                <TextBlock
                    Text="{Binding LastWriteTime.Text}"
                    Grid.Row="6"
                    Grid.Column="0" />
                <TextBlock
                    Text="{Binding LastWriteTime.Value, StringFormat='yyyy/MM/dd HH:mm:ss'}"
                    Grid.Row="6"
                    Grid.Column="1" />
            </Grid>
        </GroupBox>

        <!-- ******************************************************************
          Buttons
        ******************************************************************* -->
        <StackPanel
            Style="{StaticResource DialogFooterStyle}"
            Grid.Row="3">
            <Button
                Content="{Binding Cancel.Text}"
                Command="{Binding Cancel.Command}"
                Style="{StaticResource CancelButtonStyle}" />
            <Button
                Content="{Binding OK.Text}"
                Command="{Binding OK.Command}"
                IsDefault="True"
                Style="{StaticResource DialogButtonStyle}" />
        </StackPanel>
    </Grid>
</Window>
