summaryrefslogtreecommitdiff
path: root/Juick/Classes
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/Classes')
-rw-r--r--Juick/Classes/DelegateCommand.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/Juick/Classes/DelegateCommand.cs b/Juick/Classes/DelegateCommand.cs
index 40256e5..b9ee13a 100644
--- a/Juick/Classes/DelegateCommand.cs
+++ b/Juick/Classes/DelegateCommand.cs
@@ -3,27 +3,27 @@ using System.Windows.Input;
namespace Juick.Classes
{
- public class DelegateCommand : ICommand
+ public class DelegateCommand<T> : ICommand
{
- readonly Action<object> action;
- readonly Func<bool> canExecute;
+ readonly Action<T> _action;
+ readonly Func<bool> _canExecute;
- public DelegateCommand(Action<object> execute, Func<bool> canExecute)
+ public DelegateCommand(Action<T> execute, Func<bool> canExecute)
{
- this.action = execute;
- this.canExecute = canExecute;
+ _action = execute;
+ _canExecute = canExecute;
}
public bool CanExecute(object parameter)
{
- return canExecute();
+ return _canExecute();
}
public event EventHandler CanExecuteChanged;
public void Execute(object parameter)
{
- action(parameter);
+ _action((T)parameter);
}
public void NotifyCanExecuteChanged()