Lightweight MVVM framework for C#.
- TAlex.Mvvm - provides base view model and relay command classes.
- TAlex.Mvvm.Wpf - WPF depended implementation of message service, application class extensions and some commands.
Defining view model:
// View Model
public class TestViewModel : ViewModelBase
{
private int _intProp;
private string _strProp;
public int IntegerProperty
{
get { return _intProp; }
set { Set(ref _intProp, value); }
}
public string StringProperty
{
get { return _strProp; }
set { Set(() => StringProperty, ref _strProp, value); }
}
}
// PropertyChanged event
var target = new TestViewModel();
string actualPropName = null;
target.PropertyChanged += (e, a) => { actualPropName = a.PropertyName; };
target.IntegerProperty = 3;
Console.WriteLine(actualPropName);
Install-Package TAlex.Mvvm
Install-Package TAlex.Mvvm.Wpf
TAlex.Common is under the MIT license.