mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-13 11:09:28 +08:00
Implement ToString and GetHashCode methods for ResultItemViewModel
This commit is contained in:
parent
68ee35d03b
commit
2efcbd060a
@ -119,14 +119,20 @@ namespace Wox.ViewModel
|
||||
ResultItemViewModel r = obj as ResultItemViewModel;
|
||||
if (r != null)
|
||||
{
|
||||
var equality = string.Equals(r.Title, Title) &&
|
||||
string.Equals(r.SubTitle, SubTitle);
|
||||
return equality;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
return _result.Equals(r.RawResult);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return _result.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return _result.ToString();
|
||||
}
|
||||
|
||||
public event EventHandler<ResultOpenedEventArgs> ResultOpened;
|
||||
|
@ -79,7 +79,7 @@ namespace Wox.ViewModel
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != _selectedResult)
|
||||
if (null != value)
|
||||
{
|
||||
if (null != _selectedResult)
|
||||
{
|
||||
@ -93,8 +93,10 @@ namespace Wox.ViewModel
|
||||
_selectedResult.IsSelected = true;
|
||||
}
|
||||
|
||||
OnPropertyChanged("SelectedResult");
|
||||
}
|
||||
|
||||
OnPropertyChanged("SelectedResult");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user