Class
ViewModelBase

Base implementation of the INotifyPropertyChanged interface.

Definition

Constructors

ViewModelBase()

Declaration

cs-api-definition
protected ViewModelBase()

Methods

OnPropertyChanged(string)

Raises the PropertyChanged event.

Declaration

cs-api-definition
protected void OnPropertyChanged(string changedPropertyName = "")

Parameters

changedPropertyName

string

OnPropertyChanged<T>(Expression<Func<T>>)

Raises this object's PropertyChanged event.

Declaration

cs-api-definition
protected virtual void OnPropertyChanged<T>(Expression<Func<T>> propertyExpression)

Parameters

propertyExpression

Expression<Func<T>>

A MemberExpression, containing the property that value changed.

Remarks

Use the following syntax: this.OnPropertyChanged(() => this.MyProperty); instead of: this.OnPropertyChanged("MyProperty");.

PropertyChangedOverride(string)

Provides an entry point for inheritors to provide additional logic over the PropertyChanged routine.

Declaration

cs-api-definition
protected virtual void PropertyChangedOverride(string changedPropertyName)

Parameters

changedPropertyName

string

VerifyPropertyName(string)

Warns the developer if this object does not have a public property with the specified name. This method does not exist in a Release build.

Declaration

cs-api-definition
[Conditional("DEBUG")]
protected void VerifyPropertyName(string propertyName)

Parameters

propertyName

string

Events

PropertyChanged

Occurs immediately after a property of this instance has changed.

Declaration

cs-api-definition
public event PropertyChangedEventHandler PropertyChanged

Event Value

PropertyChangedEventHandler

Implements INotifyPropertyChanged.PropertyChanged