Class
SelectionHelper

Represents a helper class which is used for selection.

Definition

Namespace:Telerik.Windows.Controls.Primitives

Assembly:Telerik.Windows.Controls.dll

Syntax:

cs-api-definition
public class SelectionHelper

Inheritance: objectSelectionHelper

Constructors

SelectionHelper(Func<bool>, ISelectorInteraction, ISelectionBehavior, Action<object, SelectionChangedEventArgs>)

Initializes a new instance of the SelectionHelper class.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "canExecute")]
[Obsolete("Obsoleted in Q2 2014. Not used and it will be deleted in future versions.")]
public SelectionHelper(Func<bool> canExecute, ISelectorInteraction selector, ISelectionBehavior behavior, Action<object, SelectionChangedEventArgs> selectionCallBack)

Parameters

canExecute

Func<bool>

selector

ISelectorInteraction

behavior

ISelectionBehavior

selectionCallBack

Action<object, SelectionChangedEventArgs>

SelectionHelper(ISelectorInteraction, ISelectionBehavior, Action<object, SelectionChangedEventArgs>)

Initializes a new instance of the SelectionHelper class.

Declaration

cs-api-definition
public SelectionHelper(ISelectorInteraction selector, ISelectionBehavior behavior, Action<object, SelectionChangedEventArgs> selectionCallBack)

Parameters

selector

ISelectorInteraction

behavior

ISelectionBehavior

selectionCallBack

Action<object, SelectionChangedEventArgs>

Properties

IsActive

Gets a value indicating whether the selection is active.

Declaration

cs-api-definition
public bool IsActive { get; }

Property Value

bool

SelectedIndex

Gets the index of the selected item.

Declaration

cs-api-definition
public int SelectedIndex { get; }

Property Value

int

SelectedItem

Gets the selected item.

Declaration

cs-api-definition
public object SelectedItem { get; }

Property Value

object

Methods

AddToSelection(IEnumerable)

Adds items to selection.

Declaration

cs-api-definition
public void AddToSelection(IEnumerable items)

Parameters

items

IEnumerable

ClearSelection()

Clears the selection.

Declaration

cs-api-definition
public void ClearSelection()

DeselectItems(IEnumerable)

UnSelects the items.

Declaration

cs-api-definition
public void DeselectItems(IEnumerable items)

Parameters

items

IEnumerable

GetSelectedItems()

Gets the selected items.

Declaration

cs-api-definition
public IList GetSelectedItems()

Returns

IList

ResumeExecution()

Tries to execute all enqueued selection actions.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
[Obsolete("Obsoleted in Q2 2014. Not used and it will be deleted in future versions.")]
public bool ResumeExecution()

Returns

bool

Returns true if the actions can be executed, otherwise returns false.

SelectItems(IEnumerable)

Selects the items.

Declaration

cs-api-definition
public void SelectItems(IEnumerable items)

Parameters

items

IEnumerable

UpdateSelection(UIElement, bool)

Updates the selection using the container and the current selected state.

Declaration

cs-api-definition
public void UpdateSelection(UIElement container, bool isSelected)

Parameters

container

UIElement

isSelected

bool

UpdateSelectionBehavior(ISelectionBehavior)

Updates the selection behavior.

Declaration

cs-api-definition
public void UpdateSelectionBehavior(ISelectionBehavior behavior)

Parameters

behavior

ISelectionBehavior

UpdateSelectionOnUserInteraction(object, SelectionMouseState)

Updates the selection on user interaction. The second SelectionMouseState parameter is optional. By default is SelectionMouseState.Left.

Declaration

cs-api-definition
public void UpdateSelectionOnUserInteraction(object item, SelectionMouseState mouseState = SelectionMouseState.Left)

Parameters

item

object

The data item or the container that was affected by the UI selection operation.

mouseState

SelectionMouseState

Indicates which mouse button was used to perform the operations.