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
SingleSelectListViewModel
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
|
Edit this page
View Source
SingleSelectListViewModel(IEnumerable<ISelectableItem>, ISelectableItem)
Declaration
public SingleSelectListViewModel(IEnumerable<ISelectableItem> values, ISelectableItem selectedItem)
Parameters
|
Edit this page
View Source
SingleSelectListViewModel(ObservableCollection<ISelectableItem>)
Declaration
public SingleSelectListViewModel(ObservableCollection<ISelectableItem> values)
Parameters
|
Edit this page
View Source
SingleSelectListViewModel(ObservableCollection<ISelectableItem>, ISelectableItem)
Declaration
public SingleSelectListViewModel(ObservableCollection<ISelectableItem> values, ISelectableItem selectedItem)
Parameters
Properties
|
Edit this page
View Source
IsVisible
Gets or sets the IsVisible property. This observable property.
Declaration
public bool IsVisible { get; set; }
Property Value
|
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
Methods
|
Edit this page
View Source
GetByValue(ObservableCollection<ISelectableItem>, string)
Declaration
protected ISelectableItem? GetByValue(ObservableCollection<ISelectableItem> values, string value)
Parameters
Returns
|
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
Overrides
|
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