Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4042288
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:59:12+00:00 2026-05-20T12:59:12+00:00

Surprisingly one can show more than one dialog at a time by putting the

  • 0

Surprisingly one can show more than one dialog at a time by putting the ShowDialog() call on the Dispatcher:

uiDispatcher.BeginInvoke(new Func<bool?>(myWindow.ShowDialog));

How come this works and still the UI remains running responding to user interaction once the dialog is shown (I would have thought not since ShowDialog() blocks the thread it is on which has to be the UI thread), one can even go on showing new dialogs:

Window myWindow;
for(int i = 0; i < 5; i ++)
{
  myWindow = new Window(); 
  uiDispatcher.BeginInvoke(new Func<bool?>(myWindow.ShowDialog));
}

And the UI is still responsive.

Is there something I should beware of relying on this behaviour? (I want to show one dialog on top of another when some background thread wants to – this works – the only unwanted behaviour seems to be when switching apps sometimes WPF does not know which dialog should be on top – but still allows you to bring one of the dialogs to the front by clicking on it which is unusual for a dialog as clicking outside a dialog is usually not allowed).

UPDATE: One issue I have come across is if you hide one of your dialogs the user can interact with all other Windows again! (not just the other dialogs). See: WPF Dialog not modal?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T12:59:13+00:00Added an answer on May 20, 2026 at 12:59 pm

    Showing a dialog does not block the UI thread — otherwise you won’t be able to interact with the dialog.

    It merely marks the fact that there is a modal dialog outstanding, and that it should disable inputs to all other non-dialog windows.

    If you shuff a ShowDialog call into the dispatcher, the dispatcher will allow an additional dialog to be created because you are not doing something which is prohibited when a modal dialog is outstanding — which is to input into other non-dialog windows.

    Your new dialog is fully functional, because it is a dialog, and you are not trying to input into non-dialog windows.

    Switching applications should bring any modal dialog out to the front, but since you have more than one modal dialogs, the system will get confused as to which one should be top-most. I’d suggest you trap the activation event and just manually bring the necessary dialog top-most.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Surprisingly as you get good at vim, you can code even faster than standard
Surprisingly can't find a match for my question. I have one table that I
This one seems painfully obvious to me, but for some reason I can't get
Yes, I've googled it, and surprisingly got confusing answers. One page says that <
I've checked through other questions and surprisingly this question doesn't seem to have been
I am writing a junit test in order to (surprisingly) test a part of
I find it surprising that Ruby symbols can be typecasted to integers without errors.
I'm trying to change the value of a BooleanField in one of my models,
What are the differences between stored procedures and functions. Whenever there are more input,
This is one of those there's gotta be a better way questions. Let me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.