<ResourceDictionary
    x:ClassModifier="internal"
    xmlns="https://github.com/avaloniaui"
    xmlns:customControls="clr-namespace:PicView.Avalonia.CustomControls"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ControlTheme TargetType="customControls:AutoScrollViewer" x:Key="{x:Type customControls:AutoScrollViewer}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Template">
            <ControlTemplate>
                <Grid ColumnDefinitions="*,Auto" RowDefinitions="*,Auto">
                    <ScrollContentPresenter
                        Background="{TemplateBinding Background}"
                        HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}"
                        HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}"
                        Name="PART_ContentPresenter"
                        Padding="{TemplateBinding Padding}"
                        ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"
                        VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}"
                        VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}">
                        <ScrollContentPresenter.GestureRecognizers>
                            <ScrollGestureRecognizer
                                CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}"
                                CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}"
                                IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_ContentPresenter}" />
                        </ScrollContentPresenter.GestureRecognizers>
                    </ScrollContentPresenter>
                    <ScrollBar
                        Grid.Column="0"
                        Grid.Row="1"
                        Name="PART_HorizontalScrollBar"
                        Orientation="Horizontal" />
                    <ScrollBar
                        Grid.Column="1"
                        Grid.Row="0"
                        Name="PART_VerticalScrollBar"
                        Orientation="Vertical" />
                    <Canvas Grid.Column="0" Grid.Row="0">
                        <customControls:AutoScrollSign
                            HorizontalAlignment="Center"
                            IsVisible="False"
                            Name="PART_AutoScrollSign"
                            VerticalAlignment="Center" />
                    </Canvas>
                </Grid>
            </ControlTemplate>
        </Setter>

    </ControlTheme>

    <ControlTheme TargetType="customControls:AutoScrollViewer" x:Key="Main">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Template">
            <ControlTemplate>
                <Grid ColumnDefinitions="*,Auto" RowDefinitions="*,Auto">
                    <ScrollContentPresenter
                        Background="{TemplateBinding Background}"
                        HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}"
                        HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}"
                        Name="PART_ContentPresenter"
                        Padding="{TemplateBinding Padding}"
                        ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"
                        VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}"
                        VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}">
                        <ScrollContentPresenter.GestureRecognizers>
                            <ScrollGestureRecognizer
                                CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}"
                                CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}"
                                IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_ContentPresenter}" />
                        </ScrollContentPresenter.GestureRecognizers>
                    </ScrollContentPresenter>
                    <ScrollBar
                        Grid.Column="0"
                        Grid.Row="1"
                        Name="PART_HorizontalScrollBar"
                        Orientation="Horizontal"
                        Theme="{StaticResource MainScrollbar}" />
                    <ScrollBar
                        Grid.Column="1"
                        Grid.Row="0"
                        Name="PART_VerticalScrollBar"
                        Orientation="Vertical"
                        Theme="{StaticResource MainScrollbar}" />
                    <Canvas Grid.Column="0" Grid.Row="0">
                        <customControls:AutoScrollSign
                            HorizontalAlignment="Center"
                            IsVisible="False"
                            Name="PART_AutoScrollSign"
                            VerticalAlignment="Center" />
                    </Canvas>
                </Grid>
            </ControlTemplate>
        </Setter>
    </ControlTheme>

    <ControlTheme TargetType="customControls:AutoScrollViewer" x:Key="Inline">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Template">
            <ControlTemplate>
                <Panel>
                    <ScrollContentPresenter
                        Background="Transparent"
                        HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}"
                        HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}"
                        Name="PART_ContentPresenter"
                        Padding="{TemplateBinding Padding}"
                        ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"
                        VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}"
                        VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}">
                        <ScrollContentPresenter.GestureRecognizers>
                            <ScrollGestureRecognizer
                                CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}"
                                CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}"
                                IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_ContentPresenter}" />
                        </ScrollContentPresenter.GestureRecognizers>
                    </ScrollContentPresenter>
                    <ScrollBar
                        Name="PART_HorizontalScrollBar"
                        Orientation="Horizontal"
                        Theme="{StaticResource Floating}" />
                    <ScrollBar
                        HorizontalAlignment="Right"
                        Name="PART_VerticalScrollBar"
                        Orientation="Vertical"
                        Theme="{StaticResource Floating}" />
                    <Canvas>
                        <customControls:AutoScrollSign
                            HorizontalAlignment="Center"
                            IsVisible="False"
                            Name="PART_AutoScrollSign"
                            VerticalAlignment="Center" />
                    </Canvas>
                </Panel>
            </ControlTemplate>
        </Setter>
    </ControlTheme>

</ResourceDictionary>