<?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" />
        <!-- End RootFilter -->
        
        <!-- Details -->
        <controls:TabView x:Name="DetailsTabView" Grid.Row="1">
            <controls:TabView.HeaderCommandBar>
                <CommandBar>
                    <AppBarButton Label="Add" Icon="Add"/>
                    <AppBarButton Icon="Edit" Label="Edit"/>
                    <AppBarButton Icon="Delete" Label="Delete"/>
                    <AppBarSeparator/>
                    <AppBarButton Icon="Save" Label="Save"/>
                    <AppBarButton Icon="Cancel" Label="Cancel"/>
                </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 -->
        <Border Grid.Row="2" CornerRadius="10" Padding="0" BorderThickness="1" BorderBrush="{StaticResource CardStrokeColorDefaultBrush}" Background="{StaticResource CardBackgroundFillColorDefaultBrush}">
            <Grid RowSpacing="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Border Grid.Row="0" BorderBrush="{StaticResource CardStrokeColorDefaultBrush}" BorderThickness="0 0 0 1">
                    <CommandBar HorizontalAlignment="Right" DefaultLabelPosition="Right">
                        <AppBarButton x:Name="Addd" Label="Add" Icon="Add"/>
                        <AppBarButton x:Name="Editd" Icon="Edit" Label="Edit"/>
                        <AppBarSeparator/>
                        <AppBarButton x:Name="Saved" Icon="Save" Label="Save"/>
                        <AppBarButton x:Name="Canceld" Icon="Cancel" Label="Cancel"/>
                    </CommandBar>
                </Border>

                <datagrid:DataGridView x:Name="DataGrid" Grid.Row="1" OnChangeActiveRow="DataGrid_OnChangeActiveRow" />
            </Grid>


        </Border>
        <!-- End DataGridView -->

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

    </Grid>
</Page>
