2

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.

user1930728
  • 301
  • 1
  • 11
  • Looks like a duplicate of this question: http://stackoverflow.com/questions/633362/proper-way-of-creating-a-background-hotkey-with-wpf-c-preferably-without-usin?lq=1 – Sam Jan 28 '13 at 14:11

0 Answers0