diff --git a/src/Misc/App.cs b/src/Misc/App.cs index e291917..096c98e 100644 --- a/src/Misc/App.cs +++ b/src/Misc/App.cs @@ -12,6 +12,8 @@ namespace mpvnet { public static class App { + public static event Action ShowCommandPalette; + public static List TempFiles { get; } = new List(); public static string ConfPath { get => Core.ConfigFolder + "mpvnet.conf"; } diff --git a/src/Misc/Commands.cs b/src/Misc/Commands.cs index d3afbf9..cc7fc90 100644 --- a/src/Misc/Commands.cs +++ b/src/Misc/Commands.cs @@ -33,7 +33,7 @@ namespace mpvnet case "shell-execute": ProcessHelp.ShellExecute(args[0]); break; case "show-about": ShowDialog(typeof(AboutWindow)); break; case "show-audio-devices": ShowTextWithEditor("audio-device-list", Core.get_property_osd_string("audio-device-list")); break; - case "show-command-palette": ShowDialog(typeof(CommandPaletteWindow)); break; + case "show-command-palette": ShowCommandPalette(); break; case "show-commands": ShowCommands(); break; case "show-conf-editor": ShowDialog(typeof(ConfWindow)); break; case "show-decoders": ShowTextWithEditor("decoder-list", mpvHelp.GetDecoders()); break; diff --git a/src/WPF/CommandPaletteControl.xaml b/src/WPF/CommandPaletteControl.xaml new file mode 100644 index 0000000..f240d9a --- /dev/null +++ b/src/WPF/CommandPaletteControl.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/src/WPF/CommandPaletteControl.xaml.cs b/src/WPF/CommandPaletteControl.xaml.cs new file mode 100644 index 0000000..8765383 --- /dev/null +++ b/src/WPF/CommandPaletteControl.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace mpvnet.WPF +{ + /// + /// Interaction logic for CommandPaletteControl.xaml + /// + public partial class CommandPaletteControl : UserControl + { + public CommandPaletteControl() + { + InitializeComponent(); + } + } +} diff --git a/src/WPF/CommandPaletteWindow.xaml.cs b/src/WPF/CommandPaletteWindow.xaml.cs index af0e83b..8782bf2 100644 --- a/src/WPF/CommandPaletteWindow.xaml.cs +++ b/src/WPF/CommandPaletteWindow.xaml.cs @@ -25,9 +25,7 @@ namespace mpvnet ListView.ItemsSource = CollectionView; } - public Theme Theme { - get => Theme.Current; - } + public Theme Theme => Theme.Current; bool Filter(CommandItem item) { diff --git a/src/mpv.net.csproj b/src/mpv.net.csproj index 2aa467c..70c544b 100644 --- a/src/mpv.net.csproj +++ b/src/mpv.net.csproj @@ -86,6 +86,10 @@ + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -120,6 +124,9 @@ + + CommandPaletteControl.xaml + SearchTextBoxUserControl.xaml