I've been search for a solution to a slow loading wpf form. It seems that virtualization should help me out, but I must be missing something.
I'm loading 35k orders and it takes 15 seconds to load. My guess is that virtualization isn't actually working for me.
<UserControl x:Class="IntTranWin.Modules.Orders.OrderSummary.OrdersSummaryView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
<ListView BorderThickness="0" Width="Auto" ItemsSource="{Binding Path=Orders.Items}" AlternationCount="2"
IsSynchronizedWithCurrentItem="True" VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling" ScrollViewer.IsDeferredScrollingEnabled="True">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.View>
<GridView AllowsColumnReorder="true" ColumnHeaderToolTip="Orders">
<GridViewColumn Header="Number" DisplayMemberBinding="{Binding Path=OrderNumber}" Width="65" />
</GridView>
</ListView.View>
</ListView>
</UserControl>
Thanks
shreesh chandra shukla
17-Aug-2013There wasn't really anything wrong with wpf I provided. The problem was in a styling of ScrollViewer for the GridView which disabled virtualization.
I hope it will work fine.