Compartir a través de


IXRItemsControl (Compact 2013)

3/28/2014

This class represents a control that can be used to display a collection of items.

Syntax

class IXRItemsControl : public IXRControl

Inheritance Hierarchy

IXRDependencyObject

    IXRUIElement

        IXRFrameworkElement

            IXRControl

                IXRItemsControl

                    IXRSelector

                        IXRListBox

                        IXRComboBox

Methods

Method

Description

IXRItemsControl::GetDisplayMemberPath

Retrieves the name or path of the property that is displayed for each data item in the control.

IXRItemsControl::GetItems

Retrieves the collection that provides the content of this control.

IXRItemsControl::GetItemsPanel

Retrieves the template that defines the panel that controls the layout of items in this control.

IXRItemsControl::GetItemsSource

Retrieves a collection that is used to generate the content of the items control.

IXRItemsControl::GetItemTemplate

Retrieves the IXRDataTemplate that is used to display each item in this control.

IXRItemsControl::SetDisplayMemberPath

Sets the name or path of the property that is displayed for each data item in this control.

IXRItemsControl::SetItemsPanel

Sets the template that defines the panel that controls the layout of items in this control.

IXRItemsControl::SetItemsSource

Sets a collection that is used to generate the content of the items control.

IXRItemsControl::SetItemTemplate

Sets the IXRDataTemplate object that is used to display each item in 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

Use an IXRItemsControl to display a fixed set of items. There are several controls that inherit from IXRItemsControl that you can use in your application, but you can also use an IXRItemsControl directly. For example, if you have a group of IXRTextBlock objects that you want to be displayed as a non-selectable list, you can use an IXRItemsControl to contain the text.

You can populate the collection retrieved by IXRItemsControl::GetItems with one or more IXRFrameworkElement child objects. Alternatively, you can bind the items control to a data source to automatically generate the content of the items control. To set the data source, use the IXRItemsControl::SetItemsSource method, and define how the data is presented in the user interface of your application by creating a data template and calling the IXRItemsControl::SetItemTemplate or IXRItemsControl::SetDisplayMemberPath.

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

You can also define an items control in Microsoft Silverlight 3 XAML. 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 ItemsControl Class on MSDN.

.NET Framework Equivalent

System.Windows.Controls.ItemsControl

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for UI Element Management