diff options
author | Vitaly Takmazov | 2013-04-03 00:24:35 +0400 |
---|---|---|
committer | Vitaly Takmazov | 2013-04-03 00:24:35 +0400 |
commit | cc4665499b182c32481d506d2e1e65ba41a6370b (patch) | |
tree | c5ee5780a9ee91e86c8194bb7d2513562198970c /Juick/Classes | |
parent | fb1fab2e1593ba13fae8eae519f5482525eb68a1 (diff) |
DelegateCommand<T> and ReSharper refactoring
Diffstat (limited to 'Juick/Classes')
-rw-r--r-- | Juick/Classes/DelegateCommand.cs | 16 |
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() |