Skip to content

Instantly share code, notes, and snippets.

@alimbada
Created July 7, 2012 22:30
Show Gist options
  • Save alimbada/3068332 to your computer and use it in GitHub Desktop.
Save alimbada/3068332 to your computer and use it in GitHub Desktop.
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