C# Keyboard Shortcuts quit working after calling 2nd XAML window
<p>I have a software that uses multiple XAML windows for different instances: for example, to export some information, I've created secondary XAML windows with different format than the mother software. They work fine.</p>

<p>My problem is that, if I use my software without calling any of these secondary XAML windows, the shortcuts work pretty well. But as soon as I call this new XAML windows, the shortcuts don't work anymore. I need to restart the program so that they comeback alive.</p>

<p>Any clue on this behaviour?
In addition, I was not able yet to create shortcuts like CTRL+Letter for example. I have seen plenty of codes, it seems pretty straight-forward but they just don't work...</p>

<p>Code</p>

<pre><code>private void Window_KeyDown(object sender, KeyEventArgs e)
{
    Key key = e.Key;


    if ((key == Key.Left) &amp;&amp; previousButton.IsEnabled)
        button_PreviewMouseDown(previousButton, null);
    else if ((key == Key.Right) &amp;&amp; nextButton.IsEnabled)
        button_PreviewMouseDown(nextButton, null);
    //New Label
    else if (key == Key.L)
        //else if (key == Key.LeftAlt &amp;&amp; e.Key.ToString() == "L")
        NewLabel_Click(sender, e);
    // Begin Event
    else if (key == Key.B)
        BeginEvent_Click(sender, e);
    // End Event
    else if (key == Key.E)
        EndEvent_Click(sender, e);
    // Delete Label
    else if (key == Key.K)
        DeleteLabel_Click(sender, e);
    else if (key == Key.R)
        // Delete Event
        DeleteEvent_Click(sender, e);
    // Edit Label
    else if (key == Key.I)
        EditLabel_Click(sender, e);
    // Edit Event
    else if (key == Key.F)
        EditEvent_Click(sender, e);
}
</code></pre>

<p>EDIT 1</p>

<p>I found out now that as soon as I call a C# popup message box just saying "Event Created OK" the shortcuts comeback alive again!</p>

<pre><code>MessageBox.Show("Event Created");
</code></pre>

<p>Any idea why this might be happening? </p>