views:

380

answers:

1

Hi all,

What are the actual conditions that make the Silverlight 3 VirtualizingStackPanel virtualise its content?

For example is it only when elements are off screen regardless of what container it is in or does the VirtualizingStackPanel have to be in a ScrollViewer before it starts applying the virtualisation?

I ask this because the MSDN documentation does not give much information, there also seems to be very little useful information on the web and I would like to have a deeper knowledge of how it works!

Thanks people,

Adam

A: 

The idea behind the VirtualizingStackPanel is to allow it to only show items that are visible. Its normally used inside another container as its ItemsContainer:

<ListBox>
  <ListBox.ItemsContainer>
    <VirtualizingStackPanel />
  </ListBox.ItemsContainer>
</ListBox>

(Which is the default now)

Shawn Wildermuth
Hi Shawn,Thanks for responding. I was wondering exactly how it knows things are not currently displayed on screen and therefore are not drawn?Any ideas or links?Thank you,Adam