Note that there are some explanatory texts on larger screens.

plurals
  1. POOokii.Dialogs - making sure another dialog appears above Progress dialog
    text
    copied!<p>If you're unfamiliar with <strong>Ookii.Dialogs</strong>, I suggest you <a href="http://www.ookii.org/software/dialogs/" rel="nofollow" title="Ookii.Dialogs - ookii.org">look at this web page</a> first. It is <em>open source</em> and you can find source code, compiled binary, documentation and sample app as a download there.</p> <p>In my application, I'm using <strong>Ookii.Dialogs.Wpf.ProgressDialog</strong> to <em>ShowDialog(this)</em> a progress dialog that does some processing on files (<em>this</em> is always the application's main window). As expected, the progress dialog takes about a second before it actually becomes visible (even if it is already doing the processing of my files).</p> <p>In the <em>DoWork</em> thread of the progress dialog, I'm also checking whether the output files already exist and asking the user whether to overwrite each file or skip the output. I use <strong>Ookii.Dialogs.Wpf.TaskDialog</strong> to <em>ShowDialog(this)</em> a <em>"Task Dialog with Command Links"</em> (looks like <a href="http://i.msdn.microsoft.com/dynimg/IC151613.jpg" rel="nofollow" title="Task Dialogs with Command Links example">this</a>) and ask the user the overwrite question -- except when the OS doesn't support it, I fall back to a regular <em>MessageBox</em> (<strong>the problem applies to the message box as well</strong>).</p> <blockquote> <p>The problem occurs when my application finds an existing file right at the beginning of the progress dialog's <em>DoWork</em> thread. When the task dialog appears asking user whether to overwrite:</p> <p><strong>Expected behavior:</strong> The task dialog must stay on top. When the progress dialog appears (after 1s delay), it must appear behind the task dialog.</p> <p><strong>Actual behavior:</strong> The task dialog does not stay on top. When the progress dialog appears after 1s delay), it appears on top of the task dialog.</p> </blockquote> <p>The actual behavior does not occur in subsequent overwrite requests when the progress dialog is already visible. The task dialog appears correctly on top of the progress dialog for the subsequent ones, although the user can switch back and forth the two dialogs (just can't switch to the main window from either of them).</p> <p>I'm looking for this:</p> <ul> <li><strong>Best solution:</strong> Make the task dialog appear modal <strong>on the progress dialog</strong>. If the user tries to switch to progress dialog, user must not be allowed to do so.</li> <li><strong>Second best:</strong> Make the first appearance of task dialog remain on top even when the progress dialog appears after the 1s delay.</li> </ul> <p>I'm <strong>not</strong> looking for the following:</p> <ul> <li>Set the always-on-top flag of task dialog. I don't want the task dialog to appear always-on-top of every window on user's computer.</li> <li>Add a delay before task dialog's appearance. I have tried <em>Thread.Sleep()</em> even in a loop, it simply hangs the execution of everything and doesn't solve the problem.</li> <li>Wait till the progress dialog appears before showing the task dialog. Could work in theory, except I didn't find a way to know if the progress dialog has appeared or not.</li> <li>Make the dialogs modeless. I want them both to be modal. (Besides I have tried making them modeless; it doesn't help solve the problem.)</li> <li>A solution that works <em>only</em> for the task dialog. It must work for the regular message box as well.</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload