Wpf – How to close WPF application from context menu

commandwpf

Is there a command in WPF to close the application from context menu? That is, the same context menu which you get by right clicking on the title bar on any window?

There are loads of standard commands, but I am struggling to find an exit command.

Best Answer

Unfortunately this doesn't exist. You'll have to implement a custom command and call

Application.Current.Shutdown();