Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
modal dialog does receive keyboard focus after creation
posted

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).

  • 5600
    Offline posted

    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