VirtualizingStackPane
lを飾る簡単な方法はありますか?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}"/>