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

    <Border
        CornerRadius="10"
        BorderThickness="1"
        BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}">
        <Grid AllowFocusOnInteraction="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <canvas:CanvasControl
                x:Name="_Canvas"
                Grid.Row="0"
                Grid.Column="0"
                Background="Transparent"
                ClearColor="Transparent"
                IsTabStop="True"
                UseSystemFocusVisuals="True"
                Draw="Canvas_Draw"
                SizeChanged="Canvas_SizeChanged" />

            <Border Grid.Row="0" Grid.Column="1" BorderThickness="0.5,0,0,0" BorderBrush="{ThemeResource SurfaceStrokeColorFlyoutBrush}">
                <ScrollBar
                    x:Name="_VerticalScrollBar"
                    Width="18"
                    Orientation="Vertical"
                    Background="Transparent"
                    IndicatorMode="MouseIndicator"
                    CanBeScrollAnchor="True"
                    IsTabStop="False"
                    AllowFocusOnInteraction="False"
                    ValueChanged="VerticalScrollBar_ValueChanged"
                    toolkit:ScrollBarExtensions.KeepHorizontalExpanded="True"
                    toolkit:ScrollBarExtensions.KeepVerticalExpanded="True" />
            </Border>

            <Border Grid.Row="1" Grid.Column="0" BorderThickness="0,0.5,0,0" BorderBrush="{ThemeResource SurfaceStrokeColorFlyoutBrush}">
                <ScrollBar
                    x:Name="_HorizontalScrollBar"
                    Height="18"
                    Orientation="Horizontal"
                    Background="Transparent"
                    IndicatorMode="MouseIndicator"
                    CanBeScrollAnchor="True"
                    IsTabStop="False"
                    AllowFocusOnInteraction="False"
                    ValueChanged="HorizontalScrollBar_ValueChanged"
                    toolkit:ScrollBarExtensions.KeepHorizontalExpanded="True"
                    toolkit:ScrollBarExtensions.KeepVerticalExpanded="True" />
            </Border>

            <Border Grid.Row="1" Grid.Column="1" Background="{ThemeResource ScrollBarBackground}" />
        </Grid>
    </Border>
</UserControl>
