Remove harder coded text

1. Remove harder coded text, part of refactoring for PR #494
2. Remove other arguments redundant
This commit is contained in:
bao-qian 2016-02-27 00:09:12 +00:00
parent 49ca3bfd00
commit c00583dd98
4 changed files with 17 additions and 16 deletions

View File

@ -1,5 +1,6 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Input; using System.Windows.Input;
namespace Wox.ViewModel namespace Wox.ViewModel
@ -7,7 +8,7 @@ namespace Wox.ViewModel
public class BaseViewModel : INotifyPropertyChanged public class BaseViewModel : INotifyPropertyChanged
{ {
protected void OnPropertyChanged(string propertyName) protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
{ {
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
} }

View File

@ -66,7 +66,7 @@ namespace Wox.ViewModel
set set
{ {
_queryText = value; _queryText = value;
OnPropertyChanged("QueryText"); OnPropertyChanged();
HandleQueryTextUpdated(); HandleQueryTextUpdated();
} }
} }
@ -80,7 +80,7 @@ namespace Wox.ViewModel
set set
{ {
_isProgressBarTooltipVisible = value; _isProgressBarTooltipVisible = value;
OnPropertyChanged("IsProgressBarTooltipVisible"); OnPropertyChanged();
} }
} }
@ -93,7 +93,7 @@ namespace Wox.ViewModel
set set
{ {
_left = value; _left = value;
OnPropertyChanged("Left"); OnPropertyChanged();
} }
} }
@ -106,7 +106,7 @@ namespace Wox.ViewModel
set set
{ {
_top = value; _top = value;
OnPropertyChanged("Top"); OnPropertyChanged();
} }
} }
@ -119,7 +119,7 @@ namespace Wox.ViewModel
set set
{ {
_contextMenuVisibility = value; _contextMenuVisibility = value;
OnPropertyChanged("ContextMenuVisibility"); OnPropertyChanged();
} }
} }
@ -132,7 +132,7 @@ namespace Wox.ViewModel
set set
{ {
_progressBarVisibility = value; _progressBarVisibility = value;
OnPropertyChanged("ProgressBarVisibility"); OnPropertyChanged();
} }
} }
@ -145,7 +145,7 @@ namespace Wox.ViewModel
set set
{ {
_resultListBoxVisibility = value; _resultListBoxVisibility = value;
OnPropertyChanged("ResultListBoxVisibility"); OnPropertyChanged();
} }
} }
@ -158,7 +158,7 @@ namespace Wox.ViewModel
set set
{ {
_mainWindowVisibility = value; _mainWindowVisibility = value;
OnPropertyChanged("MainWindowVisibility"); OnPropertyChanged();
MainWindowVisibilityChanged?.Invoke(this, new EventArgs()); MainWindowVisibilityChanged?.Invoke(this, new EventArgs());
if (!value.IsVisible() && ContextMenuVisibility.IsVisible()) if (!value.IsVisible() && ContextMenuVisibility.IsVisible())
@ -335,7 +335,7 @@ namespace Wox.ViewModel
Action = _ => Action = _ =>
{ {
TopMostRecordStorage.Instance.Remove(result); TopMostRecordStorage.Instance.Remove(result);
App.API.ShowMsg("Succeed", "", ""); App.API.ShowMsg("Succeed");
return false; return false;
} }
}; };
@ -348,7 +348,7 @@ namespace Wox.ViewModel
Action = _ => Action = _ =>
{ {
TopMostRecordStorage.Instance.AddOrUpdate(result); TopMostRecordStorage.Instance.AddOrUpdate(result);
App.API.ShowMsg("Succeed", "", ""); App.API.ShowMsg("Succeed");
return false; return false;
} }
}; };

View File

@ -77,7 +77,7 @@ namespace Wox.ViewModel
set set
{ {
_isSelected = value; _isSelected = value;
OnPropertyChanged("IsSelected"); OnPropertyChanged();
} }
} }
@ -105,7 +105,7 @@ namespace Wox.ViewModel
Action = _ => Action = _ =>
{ {
TopMostRecordStorage.Instance.Remove(result); TopMostRecordStorage.Instance.Remove(result);
App.API.ShowMsg("Succeed", "", ""); App.API.ShowMsg("Succeed");
return false; return false;
} }
}; };
@ -118,7 +118,7 @@ namespace Wox.ViewModel
Action = _ => Action = _ =>
{ {
TopMostRecordStorage.Instance.AddOrUpdate(result); TopMostRecordStorage.Instance.AddOrUpdate(result);
App.API.ShowMsg("Succeed", "", ""); App.API.ShowMsg("Succeed");
return false; return false;
} }
}; };

View File

@ -51,7 +51,7 @@ namespace Wox.ViewModel
} }
OnPropertyChanged("SelectedResult"); OnPropertyChanged();
} }
} }
@ -65,7 +65,7 @@ namespace Wox.ViewModel
set set
{ {
_margin = value; _margin = value;
OnPropertyChanged("Margin"); OnPropertyChanged();
} }
} }