Table of Contents

Class InputViewModel

Namespace
Loehnert.Controls.Dialogs.ViewModels
Assembly
Loehnert.Controls.dll

Represents a view model for a input dialog element.

public class InputViewModel : ItemViewModelBase, INotifyPropertyChangedEx, INotifyPropertyChanged, IDataErrorInfo, IHasInputValue
Inheritance
PropertyChangedBase
InputViewModel
Implements
INotifyPropertyChangedEx
Inherited Members
PropertyChangedBase.Refresh()
PropertyChangedBase.IsNotifying
PropertyChangedBase.PropertyChanged

Constructors

InputViewModel(Type)

Initializes a new instance of the InputViewModel class.

public InputViewModel(Type inputType)

Parameters

inputType Type

Type of input value.

Exceptions

ArgumentNullException

Thrown when inputType is null.

Properties

Error

Gets an error message indicating what is wrong with this object.

public string Error { get; }

Property Value

string

An error message indicating what is wrong with this object. The default is an empty string ("").

this[string]

Gets the error message for the property with the given name.

public string this[string columnName] { get; }

Parameters

columnName string

The name of the property whose error message to get.

Property Value

string

The error message for the property. The default is an empty string ("").

Text

Gets or sets the text.

public string Text { get; set; }

Property Value

string

Validate

Gets or sets the function to validate the Value.

public Func<object, string> Validate { get; set; }

Property Value

Func<object, string>

Remarks

This function is called with Value and must return the validation message. If validation passes, the function should return null or an empty string.

Value

Gets the input value.

public object Value { get; }

Property Value

object

Returns the a value converted to input type.

ValueAsString

Gets or sets the value as string.

public string ValueAsString { get; set; }

Property Value

string