You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
David Sungaila edited this page Sep 20, 2020
·
2 revisions
Define a class, derive from PresentationBase.ViewModelCommand<> and pass your ViewModel as the generic type. Make sure there is a parameterless constructor (or none at all).
Override CanExecute to define when the command can or cannot be executed.
Implement Execute for the code your command should … execute.
publicclassAlertCommand:ViewModelCommand<AwesomeViewModel>{publicoverridevoidExecute(AwesomeViewModelparameter){System.Windows.MessageBox.Show("You just clicked that button.");}publicoverrideboolCanExecute(AwesomeViewModelparameter){returnparameter.Name!="John Doe";}}