Virtualisation not Working

Jun 4, 2013 at 1:19 PM
I look at the Virtualisation Example, but it seems it not Virtualizing!

It look with snoop and it seems like all UIItems are created!
Coordinator
Jun 5, 2013 at 2:57 PM
Edited Jun 5, 2013 at 2:57 PM
It is broken. I've entered an Issue and will have a look at it soon.
Jun 6, 2013 at 6:48 AM
I'll also look over it, maybe I can fix it!
Jun 6, 2013 at 7:11 AM
Ok, when I looked deeper at your Control, I see that you do the TreeView in a completly other way than the Microsoft one does. The SubItems are no Childs of the Parent One (in the Visual Tree). So I've no clue at the Moment how to fix the Virtualisation...
Jun 6, 2013 at 7:53 AM
They're no child elements of the parent? I thought they were. How did you find that out?
Coordinator
Jun 6, 2013 at 9:08 AM
Yes, it does work in a completely other way. And it is done that way to make virtualization work. How ironic, that it does not work now. ;o(

The idea is: Implementing virtualization vor a TreeControl is almost not possible. You would have to implement your own VirtualizingPanel. Take a look at the source code of the VirtualizingStackpanel, it is highly complex. Therefor I was using the given one, but had to transform the treestructure in a flat list, rembering the structure, so I can draw it like a tree. Microsoft has implemented virtualization in the tree, by referencing their own tree control in the VirtualizingStackpanel and implementing a special treatment for it. So there is no way for me.

As far as I've seen now, it does not work because the ScrollViewer.CanContentScroll property is not set on the treeviewex. But entering it in the style does not yield any effect? Not sure why. Maybe anyone has an idea?
Coordinator
Jun 6, 2013 at 9:35 AM
Fixed with: 72273
Jun 6, 2013 at 10:05 AM
Yes, now the initial load is fast, but it crashes if I Scroll with the ScrollBar:

This is my error: "Der Bereich von "Remove(0,2)" darf keine Elemente ohne entsprechende Benutzeroberflächenelemente enthalten." (The Range from Remove(0,2) can not contains Elements wich have no UI Elements)

Also Selecting of a TreeViewitem is very very slow in the Virtualisation Example!
Jun 6, 2013 at 10:21 AM
I think I see why selecting is so damn slow:

You go throu all Items when you call StopEditing, and Internaly for Every Item, this goes again through the list of all Items and Calls ItemContainerGenerator!

But I don't know how to fix...
Jun 22, 2013 at 10:51 PM
jogibear9988 wrote:
I think I see why selecting is so damn slow:

You go throu all Items when you call StopEditing, and Internaly for Every Item, this goes again through the list of all Items and Calls ItemContainerGenerator!

But I don't know how to fix...
Have you any Idea how to fix it?