ravendb/studio — Issue #42: Hot keys are still active after switching away from a page
Author: samueldjack
Created: 2011-11-24 15:02:42+00:00
State: open

To reproduce:
1. Go to the Database page and select a database
2. Switch away to another page
3. Press the Delete key

Notice how the "Do you want to delete?" dialog pops up.

Digging into this, it turns out that it is caused by the KeyTrigger element. For some reason, this trigger subscribes to key press events on the RootVisual, and doesn't unsubscribe from them when the actual element it is attached to is unloaded.

We can fix this by creating our own KeyTrigger which subscribes to events on the relevant item, and makes sure to unsubscribe when unloaded.