<UserControl x:Class="InABox.DynamicGrid.EmbeddedDynamicEditorForm"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:InABox.DynamicGrid"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800" >
    <Grid x:Name="LayoutGrid">

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="80" />
            <ColumnDefinition Width="80" />
        </Grid.ColumnDefinitions>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" x:Name="ButtonRow"/>
        </Grid.RowDefinitions>

        <local:DynamicEditorGrid 
            x:Name="Editor"
            Grid.Row="0"
            Grid.Column="0" 
            Grid.ColumnSpan="3" 
            Margin="0"
            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
            OnCustomiseColumns="Editor_OnCustomiseColumns"
            OnDefineFilter="Editor_OnDefineFilter"
            OnEditorCreated="Editor_OnEditorCreated"
            OnSelectPage="Editor_OnSelectPage"
            OnUnloadPage="Editor_OnUnloadPage"
            OnAfterEditorValueChanged="Editor_OnAfterEditorValueChanged"
            OnReconfigureEditors="Editor_OnReconfigureEditors"
            OnGridCustomiseEditor="Editor_OnGridCustomiseEditor"
            OnGetSequence="Editor_OnGetSequence"
            OnEditorValueChanged="Editor_OnEditorValueChanged"
            OnDefineLookups="Editor_OnDefineLookups"
            GetItems="Editor_GetItems"
            OnGetEditor="Editor_OnGetEditor"
            OnGetPropertyValue="Editor_OnGetPropertyValue"
            OnSetPropertyValue="Editor_OnSetPropertyValue"
            OnReload="Editor_OnReload"
            OnCreateEditorControl="Editor_OnCreateEditorControl"/>

        <StackPanel 
            Grid.Row="1" 
            Grid.Column="0" 
            HorizontalAlignment="Stretch" 
            Orientation="Horizontal"
            Margin="0,5,0,0"
            Height="30"
            x:Name="Buttons"/>

        <Button 
            x:Name="OKButton" 
            Content="OK" 
            Grid.Row="1"
            Grid.Column="1" 
            Margin="5,5,0,0"
            BorderThickness="0.75"
            Click="OKButton_Click"/>
        
        <Button 
            x:Name="CancelButton" 
            Content="Cancel" 
            Grid.Row="1" 
            Grid.Column="2" 

            Margin="5,5,0,0" 
            Click="CancelButton_Click"/>
        
    </Grid>
</UserControl>
