ISelectionProvider ISelectionProvider ISelectionProvider Interface

Exposes methods and properties to support access by a Microsoft UI Automation client to controls that act as containers for a collection of individual, selectable child items. The children of this element must implement ISelectionItemProvider. Implement ISelectionProvider in order to support the capabilities that an automation client requests with a GetPattern(Windows.UI.Xaml.Automation.Peers.PatternInterface) call and PatternInterface.

Syntax

Declaration

public interface ISelectionProviderpublic interface ISelectionProviderPublic Interface ISelectionProvider

Remarks

This pattern has guidelines and conventions that aren't fully documented here. For more info on what this pattern is for, see Selection Control Pattern. However, you don't need to follow the guidance regarding IRawElementProviderFragmentRoot, that is specific to COM provider implementations and the interface doesn't exist in the Windows Runtime automation provider API.

ISelectionProvider is implemented by the existing Windows Runtime class SelectorAutomationPeer, which is the base class for ComboBoxAutomationPeer and ListBoxAutomationPeer.

Use SelectionPatternIdentifiers if you want to reference the ISelectionProvider pattern properties from control code when you fire automation events or call RaisePropertyChangedEvent(Windows.UI.Xaml.Automation.AutomationProperty,System.Object,System.Object).

Properties summary

Gets a value that indicates whether the Microsoft UI Automation provider allows more than one child element to be selected concurrently.

Gets a value that indicates whether the UI Automation provider requires at least one child element to be selected.

Methods summary

Retrieves a UI Automation provider for each child element that is selected.

Properties

  • CanSelectMultiple
    CanSelectMultiple
    CanSelectMultiple
    CanSelectMultiple

    Gets a value that indicates whether the Microsoft UI Automation provider allows more than one child element to be selected concurrently.

    public bool CanSelectMultiple { get; }public bool CanSelectMultiple { get; }Public ReadOnly Property CanSelectMultiple As bool

    Property Value

    • bool
      bool
      bool

      true if multiple selection is allowed; otherwise, false.

  • IsSelectionRequired
    IsSelectionRequired
    IsSelectionRequired
    IsSelectionRequired

    Gets a value that indicates whether the UI Automation provider requires at least one child element to be selected.

    public bool IsSelectionRequired { get; }public bool IsSelectionRequired { get; }Public ReadOnly Property IsSelectionRequired As bool

    Property Value

    • bool
      bool
      bool

      true if selection is required; otherwise, false.

Methods

  • GetSelection()
    GetSelection()
    GetSelection()
    GetSelection()

    Retrieves a UI Automation provider for each child element that is selected.

    public IRawElementProviderSimple[] GetSelection()public IRawElementProviderSimple[] GetSelection()Public Function GetSelection() As IRawElementProviderSimple[]

    Returns

    • Windows.UI.Xaml.Automation.Provider.IRawElementProviderSimple[]
      Windows.UI.Xaml.Automation.Provider.IRawElementProviderSimple[]
      Windows.UI.Xaml.Automation.Provider.IRawElementProviderSimple[]

      An array of UI Automation providers.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.Foundation.Metadata.GuidAttribute

Details

Assembly

Windows.UI.Xaml.Automation.Provider.dll