PowerToys/Wox/ViewModel/ResultViewModel.cs
bao-qian b589a1a13e Move ResultListBox Visibility
1. Move ResultListBox Visibility from MainViewModel to ResultsViewModel
2. Refactoring
2016-06-23 02:26:54 +01:00

47 lines
934 B
C#

using System.Windows.Media;
using Wox.Infrastructure.Image;
using Wox.Plugin;
namespace Wox.ViewModel
{
public class ResultViewModel : BaseModel
{
public ResultViewModel(Result result)
{
if (result != null)
{
Result = result;
}
}
public ImageSource Image => ImageLoader.Load(Result.IcoPath);
public Result Result { get; }
public override bool Equals(object obj)
{
var r = obj as ResultViewModel;
if (r != null)
{
return Result.Equals(r.Result);
}
else
{
return false;
}
}
public override int GetHashCode()
{
return Result.GetHashCode();
}
public override string ToString()
{
return Result.ToString();
}
}
}