Created
July 7, 2012 22:30
-
-
Save alimbada/3068332 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class CommandBase : ICommand | |
{ | |
public abstract void Execute(); | |
public virtual bool CanExecute() | |
{ | |
return true; | |
} | |
void ICommand.Execute( object parameter ) | |
{ | |
Execute(); | |
} | |
bool ICommand.CanExecute( object parameter ) | |
{ | |
return CanExecute(); | |
} | |
public event EventHandler CanExecuteChanged | |
{ | |
add { CommandManager.RequerySuggested += value; } | |
remove { CommandManager.RequerySuggested -= value; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment