Skip to content

DevelopersTree/DevTree.Mvvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevTree.Mvvm Build Status NuGet

A tiny MVVM framework for tiny apps. Most of the time a really small MVVM framework is enough to get work done. No need for fancy stuff.

Documentation

This package contains only two classes:

BindableBase

Which serves as a base class for your ViewModels. It contains a couple of helpful methods: SetProperty<T>: This method is used to simplify notification-aware properties. It will automatically fire PropertyChanged event whenever the property is changed.

private int _myProperty;
public int MyProperty
{
    get { return _myProperty; }
    set { SetProperty(ref _myProperty, value); }
}

DelegateCommand

Which is an implementation of ICommand from WpfTutorial. Usage:

This is how you declare a command in your ViewModel:

 public ICommand SomeComamnd { get; }

And in the constructor, initialize the command like so:

SomeComamnd = new DelegateCommand(p => DoSomething(p), p => CheckIfICanDoSomething(p));

One of the useful methods of this class is it's RaisePropertyChanged which you call whenever something changes that might affect the commands ability to execute. This manual check is much more efficient than WPF's own implementation that checks whether the command can execute too frequently.

About

A tiny MVVM framework for tiny apps

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages