0

I m having very poor performance results when using ListBox + WrapPanel to display information in my WPF inside ListBox ItemsPanelTemplate.

If I remove the WrapPanel from the ListBox the information takes about 5 sec to display completely with the WrapPanel it takes about 1.10 min.

Any tips on how to improve performance on this?

The configuration is: My DataTemplate is in App.xaml and uses 1 Border, Grid, 20 TextBlocks wrapped inside 6 different VirtualizingStackPanels.

The ListBox:

<ListBox Name="myListBox"
         Margin="4"
         BorderBrush="DarkSlateGray" BorderThickness="1"
         ScrollViewer.HorizontalScrollBarVisibility="Disabled"
         ItemsSource="{Binding propList}"
         ItemTemplate="{StaticResource myDataTemplate}" >
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <WrapPanel />
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
</ListBox>

Thank You.

J_PT
  • 479
  • 4
  • 22

1 Answers1

0

WrapPanel doesnt use virtualization, if you will use other panels with virtualization enabled only the elements that are visible in the UI will be created.

Rom
  • 1,183
  • 1
  • 8
  • 18
  • Inside my DataTemplate I m using VirtualizingStackPanels (but the speed is still slow when using it inside WrapPanel), so the Question is what should I use to replace WrapPanel that offers the same Wrapping capabilites and has better performace? – J_PT Oct 06 '16 at 11:21
  • Try these links: http://www.codeproject.com/Articles/309151/Wrap-Panel-Virtualization http://www.codeproject.com/Articles/75847/Virtualizing-WrapPanel – Rom Oct 06 '16 at 11:51
  • Performs a little better especially this one:"http://virtualwrappanel.codeplex.com/SourceControl/latest#VirtualizingWrapPanel.cs" but is still very slooowww.... Any more ideas suggestions? – J_PT Oct 06 '16 at 15:09