xpaulbettsx/ReactiveUI — pull request #61 by jlaanstra (2012-04-29 22:48:42+00:00)
Title: Added helper methods for lazy command creation.

We write this piece of code all the time:

private ReactiveCommand someCommand;
public ReactiveCommand SomeCommand
{
get
{
if(this.someCommand == null)
{
this.someCommand = new ReactiveCommand(...);
}
return someCommand;
}
}

so I wrote this helper methods and I can now write the above as:

private ReactiveCommand someCommand;
public ReactiveCommand SomeCommand
{
get { return ReactiveCommand.CreateIfNull(ref this.someCommand, ...); }
}

I think this can be useful for other people as well.