I recently researched how to achieve this in WPF, and found a good solution. I wanted list mode replication in Windows Explorer, that is, from top to bottom, and then from left to right.
Basically, you want to override the ListBox.ItemsPanel property to use the WrapPanel with the orientation set to Vertical.
<ListBox> <ListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel Orientation="Vertical"/> </ItemsPanelTemplate> </ListBox.ItemsPanel> </ListBox>
However, this WILL will be slow when loading a large dataset, since the transfer panel is not virtualized. It is important. So now this task is getting a little bigger, because now you need to write your own VirtualizedWrapPanel, expanding VirtualizedPanel and implementing IScrollInfo.
public class VirtualizedWrapPanel : VirtualizedPanel, IScrollInfo {
This is until I got into my research before moving on to another task. If you need more information or examples, please comment.
UPDATE Ben Constable has an excellent series on how to implement IScrollInfo .
Only 4 articles. Very good read.
Since then I have implemented a virtualized wrapper panel, this is not an easy task even with the help of the above series of articles.
Dennis Jun 25 '09 at 6:59 2009-06-25 06:59
source share