I have a program where I've implemented some of the .NET Media Commands as Routed Commands in my MainWindow like this:
<Window.CommandBindings>
<CommandBinding Command="MediaCommands.TogglePlayPause"
Executed="ExecutePlayPause"
CanExecute="CanExecuteTogglePlayPause" />
</Window.CommandBindings>
This works correctly if the program is currently being used. However if I switch to a different program and send the TogglePlayPause MediaCommand the command is not fired (CanExecute is never called).
Is there a way to make sure my program always responds to MediaCommands, even if it is running in the background?
FWIW the program Rdio seems to be able do this. I can have it in the background, send the MediaCommand and the music will play or pause.
Thank You.