Files
mpv.net/src/MpvNet.Windows/UI/CommandPalette.cs
2023-11-04 20:24:10 +01:00

23 lines
621 B
C#

using MpvNet.Windows.WPF.Controls;
namespace MpvNet.Windows.UI;
public class CommandPalette
{
public static CommandPaletteControl Instance { get; } = new CommandPaletteControl();
public static IEnumerable<CommandPaletteItem> GetItems()
{
return InputHelp.GetBindingsFromContent(App.InputConf.GetContent())
.Where(i => i.Command != "")
.Select(i => new CommandPaletteItem()
{
Text = i.Comment,
SecondaryText = i.Input,
Action = () => Core.Command(i.Command),
Binding = i
});
}
}