<?xml version="1.0" encoding="utf-8"?>
<UserControl
    x:Class="Sonex.Client.UserControls.DataGridView.DataGridView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Sonex.Client.UserControls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:canvas="using:Microsoft.Graphics.Canvas.UI.Xaml"
    xmlns:toolkit="using:AK.Toolkit.WinUI3"
    mc:Ignorable="d"

    
    AllowFocusOnInteraction="True"
    >

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <!-- Twój renderer (np. Win2D CanvasControl) -->
        <Border Grid.Row="1" Grid.Column="1" Background="{ThemeResource ScrollBarBackground}" />

        <canvas:CanvasControl x:Name="_Canvas"
                PreviewKeyDown="_Canvas_KeyDown"
                PreviewKeyUp="_Canvas_KeyUp"
                IsHitTestVisible="True"
                IsTabStop="True"
                TabIndex="0"
                
                UseSystemFocusVisuals="True"
                Background="White"

                Grid.Row="0" Grid.Column="0">
            
        </canvas:CanvasControl>
        <ProgressBar Margin="0,0,0,0" Visibility="Collapsed" IsIndeterminate="True" ShowPaused="False" ShowError="False" VerticalAlignment="Top" />
        <ProgressRing x:Name="_ProgressRing" IsActive="False">
        </ProgressRing>
        <Border  Grid.Row="0" Grid.Column="1" BorderThickness="0.5, 0, 0, 0" BorderBrush="{ThemeResource SurfaceStrokeColorFlyoutBrush}">
            <ScrollBar x:Name="_ScrollVertical"  
                    
                    toolkit:ScrollBarExtensions.KeepVerticalExpanded="True"
                    toolkit:ScrollBarExtensions.KeepHorizontalExpanded="True"
                   Orientation="Vertical" 
                   IndicatorMode="MouseIndicator" 
                   CanBeScrollAnchor="True" 
                   Width="18" 
                   Visibility="Visible" 
                   Opacity="1" 
                   Padding="0" 
                   IsTabStop="False"
                   AllowFocusOnInteraction="False"
                   Background="Transparent" />
        </Border>
        <Border Grid.Row="1" Grid.Column="0" BorderThickness="0, 0.5, 0, 0" BorderBrush="{ThemeResource SurfaceStrokeColorFlyoutBrush}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <TextBlock x:Name="_FooterText1"  Grid.Column="0" Text="Rows: 0"  FontSize="12" Padding="8 0 8 0"  VerticalAlignment="Center"/>
                <TextBlock x:Name="_FooterText2" Grid.Column="1" Text="Selected: 0 rows"  FontSize="12" Padding="8 0 8 0"  VerticalAlignment="Center"/>
                <TextBlock x:Name="_FooterText3" Grid.Column="2" Text="Sum: 0" FontSize="12"  Padding="8 0 8 0"  VerticalAlignment="Center"/>
                <ScrollBar  
                                        toolkit:ScrollBarExtensions.KeepVerticalExpanded="True"
                    toolkit:ScrollBarExtensions.KeepHorizontalExpanded="True"
                        x:Name="_ScrollHorizontal"
                        Grid.Column="3"
                        Orientation="Horizontal"
                        IndicatorMode="MouseIndicator"
                        CanBeScrollAnchor="True"
                        Height="26"
                        Visibility="Visible"
                        Opacity="1"
                        IsTabStop="False"
                        AllowFocusOnInteraction="False"
                        Background="Transparent"
                        HorizontalAlignment="Stretch"/>
            </Grid>

        </Border>

    </Grid>
</UserControl>
