<UserControl x:Class="FileAttachments.MainPage"
    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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:PageViewSL="clr-namespace:O2S.Components.PDFView4NET.SL;assembly=O2S.Components.PDFView4NET.SL"
    mc:Ignorable="d">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!--First row-->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <!--PDF file-->
            <TextBlock Text="PDF file:" VerticalAlignment="Center"/>
            <TextBox Grid.Column="1" Margin="2" Name="FilePathTextBox" IsEnabled="False"/>
            <Button Grid.Column="2" Margin="2" Width="30" Content="..." Click="Browse_Click"/>
        </Grid>

        <!--PDFPageView-->
        <PageViewSL:PDFPageView Grid.Row="1" Name="PdfControl" Margin="0" BorderThickness="1" BorderBrush="Black"/>

        <!--Last row with buttons-->
        <Grid Grid.Row="3">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*" MinHeight="100"/>
            </Grid.RowDefinitions>

            <!--Buttons-->
            <StackPanel Orientation="Horizontal">
                <Button Margin="4" Width="120" Content="Add attachment" Click="AddAttachment_Click"/>
                <Button Margin="4" Width="120" Content="Edit description" Click="EditDescription_Click"/>
                <Button Margin="4" Width="120" Content="Save attachment" Click="SaveAttachment_Click"/>
                <Button Margin="4" Width="120" Content="Remove attachment" Click="RemoveAttachment_Click"/>
            </StackPanel>
            <Button Margin="4" Width="120" HorizontalAlignment="Right" Content="Save document" Click="SaveDocument_Click"/>

            <!--Details listview-->
            <ListBox Grid.Row="1" Name="DetailsListBox" DisplayMemberPath="FileName"/>
        </Grid>
    </Grid>
</UserControl>
