Extensions is a .NET library with common extensions and helpers for MvvmCross.
Use NuGet package manager to install this library.
Install-Package Fedandburk.MvvmCross.Extensions
using Fedandburk.MvvmCross.Extensions;
To check the execution ability and run the IMvxAsyncCommand
asynchronously:
await Command.SafeExecuteAsync(parameter);
To cancel the IMvxAsyncCommand
execution with IsRunning
check:
Command.CancelExecution();
To raise CanExecuteChanged
when one of the target properties changed:
Subscription = Command.RelayOn(
NotifyPropertyChanged,
() => NotifyPropertyChanged.Property
);
To subscribe for changes of INotifyPropertyChanged
properties:
Subscription = this.WeakSubscribe(EventHandler, () => PropertyOne, () => PropertyTwo);