MvvmLight bindings in code?
2 answers
For a typical solution:
On your page:
MyButton.SetBinding<FooViewModel>(ActivityIndicator.IsRunningProperty, model => model.IsBusy);
In your FooViewModel
bool _isBusy;
public bool IsBusy
{
get { return _isBusy; }
set
{
Set(ref _isBusy, value);
LoginCommand.RaiseCanExecuteChanged();
}
}
+2
source to share