mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-13 19:19:23 +08:00
7e7b41cd8c
part of refactoring for PR #494
41 lines
984 B
C#
41 lines
984 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.Remoting.Contexts;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using Wox.Core.UserSettings;
|
|
using Wox.Helper;
|
|
using Wox.Plugin;
|
|
using Wox.Storage;
|
|
using Wox.ViewModel;
|
|
|
|
namespace Wox
|
|
{
|
|
[Synchronization]
|
|
public partial class ResultListBox
|
|
{
|
|
public void AddResults(List<Result> newResults, string resultId)
|
|
{
|
|
var vm = this.DataContext as ResultPanelViewModel;
|
|
vm.AddResults(newResults, resultId);
|
|
}
|
|
|
|
|
|
public ResultListBox()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void lbResults_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
if (e.AddedItems.Count > 0 && e.AddedItems[0] != null)
|
|
{
|
|
lbResults.ScrollIntoView(e.AddedItems[0]);
|
|
}
|
|
}
|
|
|
|
}
|
|
} |