C#C
C#3y ago
mario12136

What control should I use?

I want to create a "feature search" command palette for my WPF application (like the one in Visual Studio). I have 1 main view model from which I want to serve commands using reflection to my command palette.

I have tried making the command palette a wpf Window and have its own view model but I was wondering if there is some control that makes more sense and that would make my life easier. Some requirements:
  • I want the control to be hidden rather than having to close and restart it again
  • When I click outside its borders I want it to be hidden again
  • I want to be able to press Escape and it becomes hidden again
  • I want to execute a command AND hide the control. Doing this has proven tricky with a Window control
I was also wondering if I should use an ItemsControl or a ListBox to show the list of available commands. I want as I am typing in the searchbox for the first item to be selected and if I press up/down I go to the next or previous item.
Was this page helpful?