<?xml version="1.0" encoding="utf-8"?>
<Page
    x:Class="Sonex.Client.Pages.Warehouse.Products"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:tk="using:CommunityToolkit.WinUI.Controls"
    xmlns:local="using:Sonex.Client.Pages.Warehouse"
    xmlns:controls="using:Sonex.Client.Controls"
    xmlns:filters="using:Sonex.Client.Controls.Filters"
    xmlns:views="using:Sonex.Client.Views"
    xmlns:layouts="using:Sonex.Client.Layouts"
    xmlns:datagrid="using:Sonex.Client.Controls.DataGridView"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    
    mc:Ignorable="d">

    <Grid Background="{StaticResource SolidBackgroundFillColorBaseBrush}" Padding="8 0 8 8" RowSpacing="8">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition MinHeight="0" Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <!-- RootFilter -->
        <filters:SqlFilterBuilder Grid.Row="0" x:Name="RootFilter" AutoApplyDefaultFilters="False" />
        <!-- End RootFilter -->
        
        <!-- Details -->
        <controls:TabView x:Name="DetailsTabView" Grid.Row="1">
            <controls:TabView.HeaderCommandBar>
                <CommandBar>
                    <AppBarButton x:Name="DetailsAddButton" Label="Add" Icon="Add" Click="DetailsAddButton_Click"/>
                    <AppBarButton x:Name="DetailsDeleteButton" Icon="Delete" Label="Delete" Click="DetailsDeleteButton_Click"/>
                    <AppBarSeparator/>
                    <AppBarButton x:Name="DetailsSaveButton" Icon="Save" Label="Save" Click="DetailsSaveButton_Click"/>
                    <AppBarButton x:Name="DetailsCancelButton" Icon="Cancel" Label="Cancel" Click="DetailsCancelButton_Click"/>
                </CommandBar>
            </controls:TabView.HeaderCommandBar>
            <controls:TabViewItem Header="Product basic information" KeyPath="Artnr">
                <views:ProductBasicInformationView x:Name="_ProductBasicInformationView"/>
            </controls:TabViewItem>
            <controls:TabViewItem Header="Product dimensions" KeyPath="Artnr">
                <views:ProductDimensionsView x:Name="_ProductDimensionsView"/>
            </controls:TabViewItem>
        </controls:TabView>
        <!-- End Details-->

        <!-- DataGridView -->
        <datagrid:DataGridViewPanel
            x:Name="DataGrid"
            Grid.Row="2"
            HeaderHeight="25"
            RowsHeight="21"
            RefreshOnLoaded="False"
            OnChangeActiveRow="DataGrid_OnChangeActiveRow"
            RefreshRequested="DataGrid_RefreshRequested" />
        <!-- End DataGridView -->

        
        
        <tk:GridSplitter Grid.Row="2"
                               Height="8"
                               VerticalAlignment="Top">
            <tk:GridSplitter.RenderTransform>
                <TranslateTransform Y="-8" />
            </tk:GridSplitter.RenderTransform>
        </tk:GridSplitter>

    </Grid>
</Page>
