<Window x:Class="InABox.DynamicGrid.DynamicFormEditWindow"
        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:local="clr-namespace:InABox.DynamicGrid"
        mc:Ignorable="d"
        Title="FormDesigner" Height="800" Width="1000" Padding="5"
        Closing="DynamicFormWindow_Closing"
        x:Name="Window">
    <Grid Margin="5" DataContext="{Binding ElementName=Window}">

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

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

        <Border Grid.Row="0" Grid.Column="0" Margin="5" BorderBrush="Gray" BorderThickness="0.75" Background="Silver">
            <ScrollViewer>
                <local:DynamicFormDesignGrid x:Name="Preview" />
            </ScrollViewer>
        </Border>

        <DockPanel Grid.Row="1">

            <Button x:Name="CompleteForm" Content="Complete Form"
                    Height="35" Padding="5" Margin="5"
                    Click="CompleteForm_Click"  DockPanel.Dock="Right" />
            <Button x:Name="SaveForm" Content="Save Progress"
                    Height="35" Padding="5" Margin="5"
                    Click="SaveForm_Click"  DockPanel.Dock="Left" />
            <Button x:Name="PrintForm" Content="Print"
                    Height="35" Padding="5" Margin="0,5,5,5" MinWidth="50"
                    Click="PrintForm_Click"  DockPanel.Dock="Left" />

            <ItemsControl ItemsSource="{Binding CustomButtons}" DockPanel.Dock="Left">
                <ItemsControl.ItemTemplate>
                    <DataTemplate DataType="local:DynamicFormEditButton">
                        <Button Content="{Binding Content}"
                                Margin="0,5,5,5" Padding="5" Height="35" MinWidth="50"
                                Tag="{Binding}"
                                Click="Button_Click"/>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
            </ItemsControl>
            
            <Label x:Name="CompletedDate" DockPanel.Dock="Left"
                   HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>

            <!--CheckBox x:Name="Complete" IsThreeState="False" Margin="5" DockPanel.Dock="Left"
                      VerticalContentAlignment="Center" Content="Complete?" Visibility="Collapsed"/-->

        </DockPanel>

    </Grid>

</Window>