// ----------------------------------------------------------------------- // // TODO: Update copyright text. // // ----------------------------------------------------------------------- using System.Windows.Input; namespace Pithos.Client.WPF { using System; using System.Collections.Generic; using System.Linq; using System.Text; /// /// TODO: Update summary. /// public class PithosCommand:ICommand { private Action _action; private Func _condition; public PithosCommand(Action execute,Func canExecute=null ) { _action = execute; _condition = canExecute; } public void Execute(object parameter) { _action(); } public bool CanExecute(object parameter) { if (_condition == null) return true; return _condition(); } public event EventHandler CanExecuteChanged; } }