Table of Contents

Class ViewModelBase

Namespace
Ecng.ComponentModel
Assembly
Ecng.ComponentModel.dll

Базовый класс для реализации View-Model в модели MVVM

public abstract class ViewModelBase : Disposable, IDisposable, INotifyPropertyChanged
Inheritance
ViewModelBase
Implements
Derived
Inherited Members
Extension Methods

Constructors

ViewModelBase()

protected ViewModelBase()

Methods

OnPropertyChanged(string)

protected virtual void OnPropertyChanged(string name = null)

Parameters

name string

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

protected void OnPropertyChanged<T>(Expression<Func<T>> selectorExpression)

Parameters

selectorExpression Expression<Func<T>>

Type Parameters

T

PropertyName<T>(Expression<Func<T>>)

public static string PropertyName<T>(Expression<Func<T>> property)

Parameters

property Expression<Func<T>>

Returns

string

Type Parameters

T

SetField<T>(ref T, T, Expression<Func<T>>)

protected bool SetField<T>(ref T field, T value, Expression<Func<T>> selectorExpression)

Parameters

field T
value T
selectorExpression Expression<Func<T>>

Returns

bool

Type Parameters

T

SetField<T>(ref T, T, string)

установка требуемого поля в определенное значение и вызов события PropertyChanged при необходимости

protected virtual bool SetField<T>(ref T field, T value, string name = null)

Parameters

field T
value T
name string

Returns

bool

Type Parameters

T

Events

PropertyChanged

public event PropertyChangedEventHandler PropertyChanged

Event Type

PropertyChangedEventHandler