forum

Home / DeveloperSection / Forums / Slow loading WPF Form.

Slow loading WPF Form.

Royce Roy2908 16-Aug-2013
Hi Guys

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 


wpf wpf 
Updated on 17-Aug-2013

Can you answer this question?


Answer

1 Answers

Liked By