Quantcast
Viewing all articles
Browse latest Browse all 18858

ListView Performance vs Custom ListView Control

Hi,

I've got a question regarding the performance of the wpf listview control. If I'm trying to fill this control with about 1000 items the initial loading/rendering of the window takes about 15 minutes.

If I now replace this ListView with a custom component the time reduces to 3 seconds.

The only thing the custom component does is scrolling automatically to the bottom when new data arrives.

My data is a contained in a dictionary. UI Virtualization is on.

This is the code of the custom ListView:

    Public Class ListViewAutoScroll
        Inherits ListView

        Public Sub New()
            AddHandler SelectionChanged, AddressOf SelectionChangedEventHandler
        End Sub

        Protected Sub SelectionChangedEventHandler(sender As Object, e As SelectionChangedEventArgs)
            ScrollIntoView(SelectedItem)
        End Sub

    End Class

Does anyone has an idea why the custom ListView performs so much better?

Thanks in advance.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>