Share via


IXRVirtualizingStackPanel (Compact 2013)

3/28/2014

This C++ class arranges and virtualizes content on a single line that is oriented either horizontally or vertically.

Syntax

class IXRVirtualizingStackPanel : public IXRVirtualizingPanel

Inheritance Hierarchy

IXRVirtualizingPanel

     IXRVirtualizingStackPanel

Methods

Method

Description

IXRVirtualizingStackPanel::AddCleanUpVirtualizedItemEventHandler

Adds an event handler to the CleanUpVirtualizedItem event, which occurs when an item is re-virtualized.

IXRVirtualizingStackPanel::GetIsVirtualizing

Retrieves a value that specifies whether this control is using virtualization.

IXRVirtualizingStackPanel::GetOrientation

Retrieves a value that describes the horizontal or vertical orientation of stacked content in a control.

IXRVirtualizingStackPanel::GetVirtualizationMode

Retrieves the virtualization mode for the content of this control.

IXRVirtualizingStackPanel::RemoveCleanUpVirtualizedItemEventHandler

Removes an event handler from the CleanUpVirtualizedItem event, which occurs when an item is re-virtualized.

IXRVirtualizingStackPanel::SetIsVirtualizing

Sets a value that specifies whether this control is using virtualization.

IXRVirtualizingStackPanel::SetOrientation

Sets a value that describes the horizontal or vertical orientation of stacked content.

IXRVirtualizingStackPanel::SetVirtualizationMode

Sets the virtualization mode for the content of this control.

Thread Safety

Members of this class are thread-safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

The standard layout system creates item containers and computes layout for each item associated with a list control. Generating many UI elements when only a few elements might be displayed on the screen can adversely affect the performance of your application. Virtualization refers to a technique by which a subset of UI elements are generated from a larger number of data items based on which items are visible on-screen. The IXRVirtualizingStackPanel class calculates the number of visible items in an IXRItemsControl (such as IXRListBox) to create UI elements only for visible items.

You can also set virtualization properties on a UI element, such as an IXRListBox object, by setting its VirtualizingStackPanel.IsVirtualizing attached property to a Boolean value, or by settings its VirtualizingStackPanel.VirtualizationMode attached property to an XRVirtualizationMode enumerated type. To set these attached properties, call IXRDependencyObject::SetAttachedProperty(const WCHAR*, const WCHAR*, WCHAR*).

Virtualization in an IXRStackPanel only occurs when the items control contained in the panel creates its own item containers. You can ensure that this happens by using data binding. For more information about data binding, see IXRPropertyBag.

An IXRVirtualizingStackPanel object is the default items host for the IXRListBox control.

When you create a class instance, use an IXRVirtualizingStackPanelPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

You can also define a virtualizing stack panel in Microsoft Silverlight 3 XAML. When defined in XAML, the VirtualizingStackPanel element must be contained within an ItemsPanelTemplate. For information about the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this element in the source XAML for your application, see the VirtualizingStackPanel class and the ItemsPanelTemplate class on MSDN.

.NET Framework Equivalent

System.Windows.Controls.VirtualizingStackPanel

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for UI Element Management
XRVirtualizationMode
XROrientation