C# Класс Open.Core.UI.Controls.ComboBoxViewModel

Provides a simple logical representation of a ComboBox.
For simple binding, set this as the DataContext of a CoreComboBox.
Наследование: ViewModelBase
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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).

Приватные методы

Метод Описание
OnSelectionChanged ( ) : void

Описание методов

Add() публичный Метод

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.
Результат ComboBoxItemViewModel

ComboBoxViewModel() публичный Метод

public ComboBoxViewModel ( ) : System
Результат System

Select() публичный Метод

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.
Результат void

SelectFirst() публичный Метод

Sets the first item in the collection as the currently SelectedItem.
public SelectFirst ( ) : void
Результат void

SelectLast() публичный Метод

Sets the last item in the collection as the currently SelectedItem.
public SelectLast ( ) : void
Результат void

SelectValue() публичный Метод

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.
Результат void