<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<controls:Page
    x:Class="MUXControlsTestApp.Samples.VirtualizingUniformStackLayoutSamplePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="http://schemas.modernwpf.com/2019"
    xmlns:samples="clr-namespace:MUXControlsTestApp.Samples">
    <Page.Resources>
        <controls:RecyclingElementFactory x:Key="elementFactory">
            <controls:RecyclingElementFactory.RecyclePool>
                <controls:RecyclePool />
            </controls:RecyclingElementFactory.RecyclePool>
            <controls:RecyclingElementFactory.Templates>
                <DataTemplate x:Key="item">
                    <Button
                        Content="{Binding}"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch" />
                </DataTemplate>
            </controls:RecyclingElementFactory.Templates>
        </controls:RecyclingElementFactory>
    </Page.Resources>
    <Grid>

        <StackPanel>
            <controls:ItemsRepeaterScrollHost
                x:Name="tracker"
                Height="400">
                <ScrollViewer>
                    <controls:ItemsRepeater
                        x:Name="repeater"
                        VerticalCacheLength="0">
                        <controls:ItemsRepeater.Layout>
                            <samples:VirtualizingUniformStackLayout
                                ItemWidth="100"
                                ItemHeight="100" />
                        </controls:ItemsRepeater.Layout>
                    </controls:ItemsRepeater>
                </ScrollViewer>
            </controls:ItemsRepeaterScrollHost>
            <StackPanel Grid.Column="2">
                <TextBlock x:Name="tb">10</TextBlock>
                <Button
                    Content="BringIntoView"
                    x:Name="bringIntoView" />
                <TextBox
                    x:Name="indexTb"
                    Text="0" />
                <TextBox
                    x:Name="countTb"
                    Text="3" />
                <Button
                    Content="Insert"
                    x:Name="insert" />
            </StackPanel>
        </StackPanel>
    </Grid>
</controls:Page>
