1

I have a UserControl with a set of Buttons and labels on it. Width 1000px Heigth 70px.

Up to 50 of them where displayed in a ListBox (or ListView I tried both). On my Notebook scrolling is absolutely no Problem BUT the target Hardware is a Tablet running Win7 on Atom Z670 (1.5GHz, 1 Core) with a Intel GMA600 @ 400MHz.

On this Tablet Scrolling is nearly impossible - stucks. It gets better when I either display less Controls at a time (higher height) or only a part of them (decreasing the ListView or BoxView width).

I already read some papers on the internet concerning WPF and scrolling but none of them really made a difference. They seem to point mainly to higher numbers of elements.

Does this mean that this hardware is just not able to perform smooth scrolling on full screen width and height or are there any further things i can to to improve the scrolling performance?

CanContentScroll does not affect this effect (http://stackoverflow.com/questions/1033841/is-it-possible-to-implement-smooth-scroll-in-a-wpf-listview)

H.B.
  • 166,899
  • 29
  • 327
  • 400
phhe
  • 209
  • 2
  • 9
  • 2
    Have you customized your Listbox? If you have, try setting the IsVirtualizing property to true: http://msdn.microsoft.com/en-us/library/system.windows.controls.virtualizingstackpanel.isvirtualizing.aspx. The default template defaults IsVirtualizing to true, but if you are using a custom template, then you'll need to explicitly set the value. – Josh Jan 05 '12 at 14:04
  • both ListView and ListBox were system default... I experimented with CanContendScroll true/false but no real difference... reaction slow and everything but "smooth". Do you think the hardware may be the problem or must it be my fault? – phhe Jan 05 '12 at 19:19

1 Answers1

0

Automation can screw big view tree's if you don't virtualize. So try out removing it.

/// <summary>
/// List View without Automation
/// Fixes the bug with tablet and touch screens
/// </summary>
public class CustomListView : ListView
{
    protected override AutomationPeer OnCreateAutomationPeer()
    {
        System.Diagnostics.Debug.Print("Automation Again");
        return null;
    }

    protected override DependencyObject GetContainerForItemOverride()
    {
        return new NoAutomatioListViewItem();
    }

}

class NoAutomatioListViewItem : ListViewItem
{
    protected override AutomationPeer OnCreateAutomationPeer()
    {
        return null;
    }
}

If not the Automation will create the whole View Tree for each Item and for a big list (15k items is enough to see problems already) it will slugish.

Lucas Locatelli
  • 356
  • 5
  • 12