Share via


IXRSelector (Compact 2013)

3/28/2014

This class represents a control that a user interacts with to select an item from a collection of items.

Syntax

class IXRSelector : public IXRItemsControl

Inheritance Hierarchy

IXRItemsControl

     IXRSelector

Methods

Method

Description

IXRSelector::AddSelectionChangedEventHandler

Attaches a delegate to the SelectionChanged event for this selector object.

IXRSelector::GetSelectedIndex

Retrieves the index of the selected item in the list.

IXRSelector::GetSelectedItem

Retrieves the selected item from the list.

IXRSelector::GetIsSelectionActive

Retrieves a value that indicates whether the selector has the keyboard focus.

IXRSelector::RemoveSelectionChangedEventHandler

Removes a delegate from the SelectionChanged event for this selector object.

IXRSelector::SetSelectedIndex

Sets the index of the selected item in the list.

IXRSelector::SetSelectedItem

Selects an item in the collection.

IXRSelector::SetIsSelectionActive

Sets a value that indicates whether the keyboard focus is within the selector object.

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

IXRSelector is an intermediate base class for both the IXRComboBox class and the IXRListBox class. Combo boxes and list boxes can use the methods that this class defines to handle information about item selections.

Item selections can result from user interactions or changes to related property values. You can attach a delegate to the selector object, which handles events that the selector object raises when the selected item changes. To attach a delegate, call IXRTextBox::AddSelectionChangedEventHandler.

IXRSelector is an items control and inherits from IXRItemsControl. You call the selector's inherited IXRItemsControl::GetItems method to retrieve the selector's content as an item collection. GetItems returns an IXRItemCollection collection object that stores the selectable items that are displayed in the list.

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

.NET Framework Equivalent

System.Windows.Controls.Primitives.Selector

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for UI Element Management