Fix mouse click issues and add a new hotmovie plugin.

This commit is contained in:
qianlifeng
2014-03-05 22:32:21 +08:00
parent 62475f9bcf
commit b38fa395ce
12 changed files with 222 additions and 7 deletions

View File

@@ -3,15 +3,27 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using Wox.Helper;
using Wox.Infrastructure;
using Wox.Plugin;
using MessageBox = System.Windows.MessageBox;
using UserControl = System.Windows.Controls.UserControl;
namespace Wox
{
public partial class ResultPanel : UserControl
{
public event Action<Result> OnMouseClickItem;
protected virtual void OnOnMouseClickItem(Result result)
{
Action<Result> handler = OnMouseClickItem;
if (handler != null) handler(result);
}
public bool Dirty { get; set; }
public void AddResults(List<Result> results)
@@ -141,5 +153,14 @@ namespace Wox
lbResults.ScrollIntoView(e.AddedItems[0]);
}
}
private void LbResults_OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
{
var item = ItemsControl.ContainerFromElement(lbResults, e.OriginalSource as DependencyObject) as ListBoxItem;
if (item != null)
{
OnOnMouseClickItem(item.DataContext as Result);
}
}
}
}