WPF show dialog at startup
I have a flag if set I would like a connection Dialog window to showu开发者_开发技巧p on startup. In App.xaml.cs in the Application_Startup event handler I have the code to show the window. What is happening is the splash screen shows (a png set to splash screen), the dialog pops up for a second then closes and the main WPF window displays. I would like the process to wait until the user closes the dialog window. Oh and the dialog window is not WPF it's a Windows.Form.
The form is this http://blogs.msdn.com/b/vsdata/archive/2010/02/02/data-connection-dialog-source-code-is-released-on-code-gallery.aspx
Any ideas?
Thanks
Rick
Do you use Show() or ShowDialog for your window ? Show() will not stop the code from running while ShowDialog() should.
Hopes that helps.
If the other window is a WinForms window (by the way, this is pertinent information I noticed in a comment) it won't behave correctly, because the whole message pump system of WinForms isn't present when the window is shown; in WPF it has been replaced by the Dispatcher. I'm afraid I don't know a solution off-hand, but searching for WPF-WinForms integration should give some answers.
精彩评论