1

VirtualizingStackPanelを飾る簡単な方法はありますか?VirtualizingStackPanelを直接入れればScrollViewer仮想化が動きます。私の目標は、メソッドをオーバーライドして、 のDecorator.OnRender()背後にジオメトリを描画することPanelです。

<Window.Resources>
    <ControlTemplate x:Key="MyControlTemplate">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <ScrollViewer CanContentScroll="True">
                <Border> <!--Decorator breaks virtualization-->
                    <VirtualizingStackPanel IsItemsHost="True"/>
                </Border>
            </ScrollViewer>
        </Grid>
    </ControlTemplate>
</Window.Resources>

<ItemsControl x:Name="MyControl" Template="{StaticResource MyControlTemplate}"/>
4

0 に答える 0