From 07c518957ec11f336b7e3c8304b8eca20d4d6aba Mon Sep 17 00:00:00 2001 From: Jason Lepp Date: Mon, 18 Oct 2010 13:52:26 -0600 Subject: Small refactoring on SimpleCommand --- src/MVPtoMVVM.mvvm/viewmodels/MainWindowViewModel.cs | 1 - src/MVPtoMVVM.mvvm/viewmodels/SimpleCommand.cs | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/MVPtoMVVM.mvvm/viewmodels/MainWindowViewModel.cs b/src/MVPtoMVVM.mvvm/viewmodels/MainWindowViewModel.cs index 2e59e0d..78509f1 100644 --- a/src/MVPtoMVVM.mvvm/viewmodels/MainWindowViewModel.cs +++ b/src/MVPtoMVVM.mvvm/viewmodels/MainWindowViewModel.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; -using System.Diagnostics; using System.Linq; using System.Linq.Expressions; using System.Windows.Input; diff --git a/src/MVPtoMVVM.mvvm/viewmodels/SimpleCommand.cs b/src/MVPtoMVVM.mvvm/viewmodels/SimpleCommand.cs index 904b000..97e5b48 100644 --- a/src/MVPtoMVVM.mvvm/viewmodels/SimpleCommand.cs +++ b/src/MVPtoMVVM.mvvm/viewmodels/SimpleCommand.cs @@ -5,12 +5,10 @@ namespace MVPtoMVVM.mvvm.viewmodels public class SimpleCommand : IObservableCommand { private readonly Action command; - private Func predicate; + private readonly Func predicate; + public event EventHandler CanExecuteChanged = (o, e) => { }; - public SimpleCommand(Action command): this(command, () => true) - { - - } + public SimpleCommand(Action command): this(command, () => true) {} public SimpleCommand(Action command, Func predicate) { @@ -33,6 +31,5 @@ namespace MVPtoMVVM.mvvm.viewmodels CanExecuteChanged(this, EventArgs.Empty); } - public event EventHandler CanExecuteChanged = (o,e)=>{}; } } \ No newline at end of file -- cgit v1.2.3