If you press a button that spawns a modal xamDialogWindow and then you press "Enter", the enter key will fire on the button that spawned the window, not on the content of the dialog window.
This can be seen in your feature browser in xamDialogWindow ->key features - > modal dialogs. Click the "show dialog" button once with your mouse. Then press enter on your keyboard.
Nothing will look out of the normal but you will have to close 2 modal dialog windows (because an extra window was spawned after pressing enter because the dialog window did not receive keyboard focus and the button "show dialog" did not become 100% disabled).
You can really see the problem if after pressing the show dialog button, you press enter 15 times (you will have to close 15 modal windows).
Hello,
Yes you are right. But this case has simple solution.
For example if you create xamDialogWindow instance in buttonClick event:
private void Button_Click(object sender, RoutedEventArgs e)
{
XamDialogWindow dialogWnd = new XamDialogWindow();
dialogWnd.IsModal = true;
mainGrid.Children.Add(dialogWnd);
dialogWnd.Show();
dialogWnd.Focus();
}
Focus() method fixes the problem.
Hope this helps you.
Regards,
Anastas