Class ViewModelBase
Base class for all ViewModel classes. It provides support for property change notifications and has a DisplayName property. This class is abstract.
Inheritance
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.dll
Syntax
public abstract class ViewModelBase : Object, INotifyPropertyChanged, IDisposable
Constructors
ViewModelBase()
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
System.Boolean
disposing
|
InvokeOnUIThread(Action)
Invokes the specified action on the UI thread.
Declaration
public static void InvokeOnUIThread(Action action)
Parameters
System.Action
action
An Action to be invoked on the UI thread. |
OnPropertyChanged(String)
Raises this object's PropertyChanged event.
Declaration
protected virtual void OnPropertyChanged(string propertyName)
Parameters
System.String
propertyName
The property that has a new value. |
OnPropertyChanged<T>(Expression<Func<T>>)
Raises this object's PropertyChanged event.
Declaration
protected virtual void OnPropertyChanged<T>(Expression<Func<T>> propertyExpression)
Parameters
System.Linq.Expressions.Expression<System.Func<T>>
propertyExpression
A MemberExpression, containing the property that value changed. |
Type Parameters
T
|
Remarks
Use the following syntax: this.OnPropertyChanged(() => this.MyProperty); instead of: this.OnPropertyChanged("MyProperty");.
RaisePropertyChanged(String)
Raises this object's PropertyChanged event. This method uses CallerMemberName attribute to identify the source property when called without parameter.
Declaration
protected void RaisePropertyChanged(string propertyName = null)
Parameters
System.String
propertyName
The property that has a new value. |
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
protected void VerifyPropertyName(string propertyName)
Parameters
System.String
propertyName
|
Events
PropertyChanged
Raised when a property on this object has a new value.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
System.ComponentModel.PropertyChangedEventHandler
|