C# Class Open.Core.UI.Controls.ComboBoxViewModel

Provides a simple logical representation of a ComboBox.
For simple binding, set this as the DataContext of a CoreComboBox.
Inheritance: ViewModelBase
ファイルを表示 Open project: philcockfield/Open.TestHarness.SL Class Usage Examples

Public Methods

Method Description
Add ( string text, object value ) : ComboBoxItemViewModel

Adds a new item to the combo-box.

ComboBoxViewModel ( ) : System
Select ( int index ) : void

Sets the element at the specified index as the currently SelectedItem.

This method sets the SelectedItem to null if the 'index' is outside the range of 'Items'.

SelectFirst ( ) : void

Sets the first item in the collection as the currently SelectedItem.

SelectLast ( ) : void

Sets the last item in the collection as the currently SelectedItem.

SelectValue ( object value ) : void

Selects the item with the specified value (of sets the SelectedItem to null if the value does not exist within the 'Items' collection).

Private Methods

Method Description
OnSelectionChanged ( ) : void

Method Details

Add() public method

Adds a new item to the combo-box.
public Add ( string text, object value ) : ComboBoxItemViewModel
text string The display text of the item.
value object The value for the item.
return ComboBoxItemViewModel

ComboBoxViewModel() public method

public ComboBoxViewModel ( ) : System
return System

Select() public method

Sets the element at the specified index as the currently SelectedItem.
This method sets the SelectedItem to null if the 'index' is outside the range of 'Items'.
public Select ( int index ) : void
index int The index of the item to select.
return void

SelectFirst() public method

Sets the first item in the collection as the currently SelectedItem.
public SelectFirst ( ) : void
return void

SelectLast() public method

Sets the last item in the collection as the currently SelectedItem.
public SelectLast ( ) : void
return void

SelectValue() public method

Selects the item with the specified value (of sets the SelectedItem to null if the value does not exist within the 'Items' collection).
public SelectValue ( object value ) : void
value object The value to select.
return void