There are not very many options for a virtualizing wrap panel for use in WPF. For one reason or another MS decided to not ship one in the standard library.
If anyone could be so bold as to provide a crowd source answer (and explaination) to the first work item on the following codeplex project, I would greatly appreciate it:
http://virtualwrappanel.codeplex.com/workitem/1
Thanks!
Summary of issue:
I’ve recently tried using the virtualizing wrappanel from this project and have encountered a bug.
Steps to reproduce:
- Create listbox.
- Set the virtualizing wrappanel as the itemhost in a listboxpanel template.
- Bind the itemsource of the listbox to an observable collection.
- Remove an item from the backing observable collection.
The Debug.Assert fails (Debug.Assert(child == _children[childIndex], “Wrong child was generated”);) in MeasureOverride, and continued execution results in a null exception in the Cleanup method [see attached screenshot].
Please let me know if you are able to correct this.
Thanks,
AO
Code:
http://virtualwrappanel.codeplex.com/SourceControl/list/changesets#
alt text http://virtualwrappanel.codeplex.com/Project/Download/AttachmentDownload.ashx?ProjectName=virtualwrappanel&WorkItemId=1&FileAttachmentId=138959
The OnItemsChanged method needs to properly handle the args parameters. Please see this question for more information. Copying the code from that question, you would need to update OnItemsChanged like so: