Show / Hide Table of Contents

Class SingleSelectListViewModel

A view model that can be selected. This is useful for list boxes and combo boxes when you want to bind to a list of items.

Inheritance
object
ViewModelBase
SelectableCollectionViewModel<ISelectableItem>
SingleSelectListViewModel
Implements
INotifyPropertyChanged
IVisibleField
Inherited Members
SelectableCollectionViewModel<ISelectableItem>._Items
SelectableCollectionViewModel<ISelectableItem>.HasOnItemSelectedSubscriber
SelectableCollectionViewModel<ISelectableItem>.OnItemSelected
SelectableCollectionViewModel<ISelectableItem>.RefreshSelectedItem(bool)
SelectableCollectionViewModel<ISelectableItem>.Clear()
SelectableCollectionViewModel<ISelectableItem>.Add(ISelectableItem)
SelectableCollectionViewModel<ISelectableItem>.Remove(ISelectableItem)
SelectableCollectionViewModel<ISelectableItem>.ItemsPropertyName
SelectableCollectionViewModel<ISelectableItem>.Items
SelectableCollectionViewModel<ISelectableItem>.OnItemPropertyChanged(object, PropertyChangedEventArgs)
SelectableCollectionViewModel<ISelectableItem>.GetSelectedItems()
SelectableCollectionViewModel<ISelectableItem>.SelectedItem
SelectableCollectionViewModel<ISelectableItem>.Count
SelectableCollectionViewModel<ISelectableItem>.AllowMultipleSelections
SelectableCollectionViewModel<ISelectableItem>.IsValid
SelectableCollectionViewModel<ISelectableItem>.IsEnabled
ViewModelBase.RaisePropertyChanged(string)
ViewModelBase.PropertyChanged
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Benday.Presentation
Assembly: Benday.Presentation.dll
Syntax
public class SingleSelectListViewModel : SelectableCollectionViewModel<ISelectableItem>, INotifyPropertyChanged, IVisibleField

Constructors

| Edit this page View Source

SingleSelectListViewModel()

Declaration
protected SingleSelectListViewModel()
| Edit this page View Source

SingleSelectListViewModel(IEnumerable<ISelectableItem>)

Declaration
public SingleSelectListViewModel(IEnumerable<ISelectableItem> values)
Parameters
Type Name Description
IEnumerable<ISelectableItem> values
| Edit this page View Source

SingleSelectListViewModel(IEnumerable<ISelectableItem>, ISelectableItem)

Declaration
public SingleSelectListViewModel(IEnumerable<ISelectableItem> values, ISelectableItem selectedItem)
Parameters
Type Name Description
IEnumerable<ISelectableItem> values
ISelectableItem selectedItem
| Edit this page View Source

SingleSelectListViewModel(ObservableCollection<ISelectableItem>)

Declaration
public SingleSelectListViewModel(ObservableCollection<ISelectableItem> values)
Parameters
Type Name Description
ObservableCollection<ISelectableItem> values
| Edit this page View Source

SingleSelectListViewModel(ObservableCollection<ISelectableItem>, ISelectableItem)

Declaration
public SingleSelectListViewModel(ObservableCollection<ISelectableItem> values, ISelectableItem selectedItem)
Parameters
Type Name Description
ObservableCollection<ISelectableItem> values
ISelectableItem selectedItem

Properties

| Edit this page View Source

IsVisible

Gets or sets the IsVisible property. This observable property.

Declaration
public bool IsVisible { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

ValidationMessage

Gets or sets the ValidationMessage property. This observable property. NOTE: this class does not do any validation logic on its own. It is up to the consumer to set this value.

Declaration
public string ValidationMessage { get; set; }
Property Value
Type Description
string

Methods

| Edit this page View Source

GetByValue(ObservableCollection<ISelectableItem>, string)

Declaration
protected ISelectableItem? GetByValue(ObservableCollection<ISelectableItem> values, string value)
Parameters
Type Name Description
ObservableCollection<ISelectableItem> values
string value
Returns
Type Description
ISelectableItem
| Edit this page View Source

Initialize(IEnumerable<ISelectableItem>)

Initializes the view model with the specified values. Values are copied into a new ObservableCollection.

Declaration
public override void Initialize(IEnumerable<ISelectableItem> values)
Parameters
Type Name Description
IEnumerable<ISelectableItem> values
Overrides
SelectableCollectionViewModel<ISelectableItem>.Initialize(IEnumerable<ISelectableItem>)
| Edit this page View Source

SelectByText(string)

Searches the list of items for the specified text and selects the item if found. If not found, the selected item is set to null.

Declaration
public void SelectByText(string text)
Parameters
Type Name Description
string text
| Edit this page View Source

SelectByValue(int)

Searches the list of items for the specified value and selects the item if found.

Declaration
public void SelectByValue(int value)
Parameters
Type Name Description
int value
| Edit this page View Source

SelectByValue(string)

Searches the list of items for the specified value and selects the item if found.

Declaration
public virtual void SelectByValue(string value)
Parameters
Type Name Description
string value

Implements

INotifyPropertyChanged
IVisibleField
  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com