This commit is contained in:
Frank Skare
2019-05-13 02:48:46 +02:00
parent fc3c5ee3a7
commit a7b6f79ee1
2 changed files with 5 additions and 3 deletions

View File

@@ -107,12 +107,14 @@ namespace mpvnet
private void ListView_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape) Close();
if (e.Key == Key.Enter) Execute();
}
void Execute()
{
if (ListView.SelectedItem != null)
mp.LoadFiles(ListView.SelectedItem as string);
Keyboard.Focus(FilterTextBox);
}
private void ListView_MouseUp(object sender, MouseButtonEventArgs e)
@@ -148,13 +150,12 @@ namespace mpvnet
string ext = Path.GetExtension(buf.ToString()).TrimStart('.').ToLower();
if (App.AudioTypes.Contains(ext) || App.VideoTypes.Contains(ext))
items.Add(buf.ToString());
if (items.Count > 20) break;
if (items.Count > 100) break;
}
Application.Current.Dispatcher.Invoke(() => {
ListView.ItemsSource = items;
SelectFirst();
});
throw null;
}
catch (Exception)
{