Skip to end of metadata
Go to start of metadata

Remarks

ISSelection control is base class for all ClientUI selection control. This type of control has properties that indicate the current selection such as SelectedIndex, SelectedItem, SelectedValue, SelectedValuePath, SelectedElement which you can bind to a DataContext or using MVVM pattern. To learn more about using MVVM pattern, see MVVM Pattern Overview.

Any changes to one of the properties means that the current selection has changed, and it will synchronize the UI and other related properties automatically.

The base class for selection controls in ClientUI is ISSelectionControl which implements ISelection interface.

The following example shows how these properties working together.

AXML
C#

This sample demonstrates that whenever you change the selection, the SelectedIndex and SelectedItem properties are synchronized automatically and vice versa. When these properties are changed, the UI of the selection control will be updated as well.

Definition

public abstract class ISSelectionControl : ISItemsControl, ISelection

Summary

The following table summarizes the members exposed in this class.

Protected Constructors

Public Properties

IsTextSearchCaseSensitiveGets or sets a value that determines whether text search is case sensitive.
IsTextSearchEnabledGets or sets a value that determines whether text search is enabled.
SelectedElementGets or sets the current selected element.
SelectedIndexGets or sets the current selected index.
SelectedItemGets or sets the current selected item.
SelectedValueGets the current selected value. Only applicable if selected value path is specified.
SelectedValuePathGets or sets the selected value path.

Protected Properties

IsControlInitializedGets or sets a value indicating whether the control has passed the initialization phase.
IsSelectionPendingGets or sets a value indicating whether the control has pending selection process.
SearchTextGets or sets current text search string.

Fields

IsNavigationSuppressedPropertyIdentifies the IsVirtualContent dependency property.
IsTextSearchCaseSensitivePropertyIdentifies the IsTextSearchCaseSensitive dependency property.
IsTextSearchEnabledPropertyIdentifies the IsTextSearchEnabled dependency property.
SelectedElementPropertyIdentifies the SelectedElement dependency property.
SelectedIndexPropertyIdentifies the SelectedIndex dependency property.
SelectedItemPropertyIdentifies the SelectedItem dependency property.
SelectedValuePathPropertyIdentifies the SelectedValuePath dependency property.
SelectedValuePropertyIdentifies the SelectedValue dependency property.
SelectionChangedEventIdentifies the SelectionChanged routed event.

Static Methods

GetIsNavigationSuppressed(DependencyObject)Gets the value of the IsNavigationSuppressed property attached to the specified object.
SetIsNavigationSuppressed(DependencyObject, bool)Sets the value of the IsNavigationSuppressed property attached to the specified object.

Public Methods

GetSelectedItem()Get selected item element.
OnApplyTemplate()Builds the visual tree for the ISSelectionControl when a new template is applied.
Select(int)Select the item on specified index.
Select(object)Select the specified item.
SelectValue(int)Set the selected value based on specified index
Unselect(int)Unselect the item at specified index.
Unselect(object)Unselect the specified item.

Protected Methods

ApplyBinding(DependencyObject, object)Applies item binding for each generated element.
ArrangeOverride(Size)Provides the behavior for the Arrange pass of Silverlight layout.
ClearSelection(object)Clear current selection.
DoFocus(UIElement)Perform focus.
DoLostFocus(UIElement)Perform lost focus.
FocusChanged(bool)Focus changed
GetItemContext(object)Get item's context.
GetItemElement(object)Gets item's element.
InitializeSelection()Initialize selection.
InitializeSelection(DependencyObject, object)Initialize selection.
OnGotFocus(RoutedEventArgs)Called before the GotFocus event occurs.
OnItemsChanged(NotifyCollectionChangedEventArgs)Called when the value of the ItemsControl.Items property changes.
OnLostFocus(RoutedEventArgs)Called before the LostFocus event occurs.
OnSelectedIndexChanged(int, int)Called when the value of the SelectedIndex property changes.
OnSelectedItemChanged(object, object)Called when the value of the SelectedItem property changes.
OnSelectedValueChanged(object, object)Called when the value of the SelectedValue property changes.
PerformTextSearch(KeyEventArgs)Perform text search.
PerformTextSearch()Perform text search.
PrepareContainerForItemOverride(DependencyObject, object)Prepares the specified element to display the specified item.

Events

SelectionChangedOccurs when the selection of a ISelection changes.

Protected Constructors

protected ISSelectionControl()

 

Public Properties

public bool IsTextSearchCaseSensitive { get; set; }

Gets or sets a value that determines whether text search is case sensitive.

public bool IsTextSearchEnabled { get; set; }

Gets or sets a value that determines whether text search is enabled.

public UIElement SelectedElement { get; set; }

Gets or sets the current selected element.

public int SelectedIndex { get; set; }

Gets or sets the current selected index.

public object SelectedItem { get; set; }

Gets or sets the current selected item.

public object SelectedValue { get; set; }

Gets the current selected value. Only applicable if selected value path is specified.

public string SelectedValuePath { get; set; }

Gets or sets the selected value path.

Protected Properties

protected bool IsControlInitialized { get; set; }

Gets or sets a value indicating whether the control has passed the initialization phase.

protected bool IsSelectionPending { get; set; }

Gets or sets a value indicating whether the control has pending selection process.

protected string SearchText { get; set; }

Gets or sets current text search string.

Fields

public static readonly DependencyProperty IsNavigationSuppressedProperty

Identifies the IsVirtualContent dependency property.

public static readonly DependencyProperty IsTextSearchCaseSensitiveProperty

Identifies the IsTextSearchCaseSensitive dependency property.

public static readonly DependencyProperty IsTextSearchEnabledProperty

Identifies the IsTextSearchEnabled dependency property.

public static readonly DependencyProperty SelectedElementProperty

Identifies the SelectedElement dependency property.

public static readonly DependencyProperty SelectedIndexProperty

Identifies the SelectedIndex dependency property.

public static readonly DependencyProperty SelectedItemProperty

Identifies the SelectedItem dependency property.

public static readonly DependencyProperty SelectedValuePathProperty

Identifies the SelectedValuePath dependency property.

public static readonly DependencyProperty SelectedValueProperty

Identifies the SelectedValue dependency property.

public static readonly RoutedEvent SelectionChangedEvent

Identifies the SelectionChanged routed event.

Static Methods

public static bool GetIsNavigationSuppressed(DependencyObject obj)

Gets the value of the IsNavigationSuppressed property attached to the specified object.

Parameters

objThe object to query.

Return Types

A boolean value.

 

public static void SetIsNavigationSuppressed(DependencyObject obj, bool value)

Sets the value of the IsNavigationSuppressed property attached to the specified object.

Parameters

objThe object of which property to set.
valueA boolean value.

 

Public Methods

public ISelectionItem GetSelectedItem()

Get selected item element.

Return Types

Selected item element.

 

public void OnApplyTemplate()

Builds the visual tree for the ISSelectionControl when a new template is applied.

public void Select(int index)

Select the item on specified index.

Parameters

indexIndex.

 

public void Select(object item)

Select the specified item.

Parameters

itemItem.

 

public void SelectValue(int newIndex)

Set the selected value based on specified index

Parameters

newIndex 

 

public void Unselect(int index)

Unselect the item at specified index.

Parameters

indexIndex.

 

public void Unselect(object item)

Unselect the specified item.

Parameters

itemItem.

 

Protected Methods

protected void ApplyBinding(DependencyObject element, object item)

Applies item binding for each generated element.

Parameters

elementContainer element.
itemItem.

 

protected Size ArrangeOverride(Size finalSize)

Provides the behavior for the Arrange pass of Silverlight layout.

Parameters

finalSizeThe final area within the parent that this object should use to arrange itself and its children.

Return Types

The actual size used once the element is arranged.

 

protected void ClearSelection(object except)

Clear current selection.

Parameters

exceptExcept specified object.

 

protected void DoFocus(UIElement focusedItem)

Perform focus.

Parameters

focusedItemFocus item.

 

protected void DoLostFocus(UIElement focusedItem)

Perform lost focus.

Parameters

focusedItemFocus item.

 

protected void FocusChanged(bool haveFocus)

Focus changed

Parameters

haveFocusHave focus

 

protected object GetItemContext(object item)

Get item's context.

Parameters

itemItem.

Return Types

Data Context.

 

protected ISelectionItem GetItemElement(object item)

Gets item's element.

Parameters

itemItem.

Return Types

Element.

 

protected void InitializeSelection()

Initialize selection.

protected void InitializeSelection(DependencyObject element, object item)

Initialize selection.

Parameters

elementThe container element used to display the specified item.
itemThe item to display.

 

protected void OnGotFocus(RoutedEventArgs e)

Called before the GotFocus event occurs.

Parameters

eThe data for the event.

 

protected void OnItemsChanged(NotifyCollectionChangedEventArgs e)

Called when the value of the ItemsControl.Items property changes.

Parameters

eNotifyCollectionChangedEventArgs that contains the event data

 

protected void OnLostFocus(RoutedEventArgs e)

Called before the LostFocus event occurs.

Parameters

eThe data for the event.

 

protected void OnSelectedIndexChanged(int oldIndex, int newIndex)

Called when the value of the SelectedIndex property changes.

Parameters

oldIndexThe old value of the SelectedIndex property.
newIndexThe new value of the SelectedIndex property.

 

protected void OnSelectedItemChanged(object oldItem, object newItem)

Called when the value of the SelectedItem property changes.

Parameters

oldItemThe old value of the SelectedItem property.
newItemThe new value of the SelectedItem property.

 

protected void OnSelectedValueChanged(object oldValue, object newValue)

Called when the value of the SelectedValue property changes.

Parameters

oldValueThe old value of the SelectedValue property.
newValueThe new value of the SelectedValue property.

 

protected void PerformTextSearch(KeyEventArgs e)

Perform text search.

Parameters

e 

 

protected void PerformTextSearch()

Perform text search.

protected void PrepareContainerForItemOverride(DependencyObject element, object item)

Prepares the specified element to display the specified item.

Parameters

elementThe container element used to display the specified item.
itemThe item to display.

 

Events

public event SelectionChangedEventHandler SelectionChanged

Occurs when the selection of a ISelection changes.

  • No labels