Bug Fixing - IsSelected is not implemented in ResultItemViewModel

If this property is not implemented, the Theme of selected search result
won't take effect.
This commit is contained in:
Colin Liu 2016-02-19 21:36:44 +08:00
parent 1b6a43ae15
commit 68ee35d03b
2 changed files with 27 additions and 2 deletions

View File

@ -14,6 +14,7 @@ namespace Wox.ViewModel
#region Private Fields
private Result _result;
private bool _isSelected;
#endregion
@ -77,6 +78,16 @@ namespace Wox.ViewModel
}
}
public bool IsSelected
{
get { return _isSelected; }
set
{
_isSelected = value;
OnPropertyChanged("IsSelected");
}
}
public RelayCommand OpenResultCommand
{
get;

View File

@ -79,8 +79,22 @@ namespace Wox.ViewModel
}
set
{
this._selectedResult = value;
OnPropertyChanged("SelectedResult");
if (value != _selectedResult)
{
if (null != _selectedResult)
{
_selectedResult.IsSelected = false;
}
_selectedResult = value;
if (null != _selectedResult)
{
_selectedResult.IsSelected = true;
}
OnPropertyChanged("SelectedResult");
}
}
}