I am trying to create a view that looks like a bookshelf with items located on a shelf with virtualization. I was able to achieve this by adding the VirtualizingTilePanel class to my ListView . The class I'm using is Dan Crevier's blog here: http://blogs.msdn.com/b/dancre/archive/2006/02/16/implementing-a-virtualizingpanel-part-4-the-goods.aspx
I add a VirtualizingTilePanel and background to my ListView as follows:
<ListView.ItemsPanel> <ItemsPanelTemplate> <local:VirtualizingTilePanel> <local:VirtualizingTilePanel.Background> <ImageBrush ImageSource="..\Images\bookshelf.png" AlignmentX="Left" AlignmentY="Top" TileMode="Tile" Stretch="None" ViewportUnits="Absolute" Viewport="0,0,319,203" /> </local:VirtualizingTilePanel.Background> </local:VirtualizingTilePanel> </ItemsPanelTemplate> </ListView.ItemsPanel>
The problem is that the background fills only the original visible area. As soon as I start scrolling, the background moves up (as I want), but the background that appears in plain view is just white.
How to get the background fill of the entire scroll pane?
Hope this makes sense, I can add pictures if necessary.
Edit
My VirtualizingTilePanel class:
class VirtualizingTilePanel : VirtualizingPanel, IScrollInfo { public VirtualizingTilePanel() {
Chris source share