Remove redundant code

1. remove this
2. auto property should be only 1 line
3. misc
4. part of refactoring for PR #494
This commit is contained in:
bao-qian
2016-02-21 15:42:37 +00:00
parent 533bc4c2fe
commit 320f78b31b
9 changed files with 232 additions and 347 deletions

View File

@@ -11,11 +11,11 @@ namespace Wox.ViewModel
public class BaseViewModel : INotifyPropertyChanged
{
protected virtual void OnPropertyChanged(string propertyName)
protected void OnPropertyChanged(string propertyName)
{
if (null != this.PropertyChanged)
if (null != PropertyChanged)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
@@ -29,7 +29,7 @@ namespace Wox.ViewModel
public RelayCommand(Action<object> action)
{
this._action = action;
_action = action;
}
public virtual bool CanExecute(object parameter)
@@ -41,9 +41,9 @@ namespace Wox.ViewModel
public virtual void Execute(object parameter)
{
if (null != this._action)
if (null != _action)
{
this._action(parameter);
_action(parameter);
}
}
}