There are still a few bugs around scrollbar behavior, and maybe Grid. To
see them, add a long item in the middle of VirtualizationTest's items,
resize the window to require a scrollbar and scroll up and down.
Rather than repainting whenever, this adds a render loop which is called
N times per second. IRenderQueueManager and ITopLevelRenderer have been
removed, replaced by IRenderer.
@donandren correctly identified a problem with the `ItemsPresenter` but
he put the tests in the `ListBox` tests. Moved them to the correct
place. Also tweak formatting in `ItemContainerGenerator.InsertSpace`.
When a virtualized list was scrolled to the bottom and then the list was
measured with a size larger than needed to fit all items (in this case
we use infinity) then the virtualizer tries to go backwards to add items
at the top of the currently visible items by setting `step = -1`;
however it didn't check whether the current index was < 0.
Fixes#589.
Don't add virtualized items before the virtualizing panel is attached to
the visual tree, as bindings etc won't be set and so measurement will
produce 0,0 causing all items to be materialized.
- Set `InheritanceParent` before Parent so that control doesn't
initially inherit the wrong DataContext
- Don't set `InheritanceParent` when setting `Parent` if
`InheritanceParent` already set
- Added `IDataTemplate.SupportsRecycling`
If a `ContentPresenter`s content is assigned a value which matches the
current `DataTemplate` then just change the
`ContentPresenter.DataContext` and the existing item will update itself.
Make the untyped ItemContainerGenerator create `ContentPresenter`
containers when the data isn't a control. This is required for correct
binding to `DataContext` in a data template.
Because even when virtualized we were still creating a list the size of
the Items collection to store the containers. Using Dictionary here
still isn't ideal - we'd ideally use some sort of sparse array but that
can be optimized later.