In WPF application, I would like to show window b as a dialog inside window a when window a is loaded.
I do this with the following pseudocode:
window a.Loaded += WindowALoaded();
WindowALoaded
{
window b.ShowDialog();
}
This works. However, it displays window b, and window a does not get displayed until I close window b. I would like to display window a completely, and then window b. How would I accomplish this?
Its because in the load event of WindowA, it does a ShowDialog() of WindowB which then haults all code in WindowA until WindowB is closed. If you do just WindowB.Show(), you should probably see WindowA get loaded. You might need to mess with the Window.Focus() and/or the Window.TopMost properties, depending on how you want to windows to be displaying on top of each other.
There also is a Window.ContentRendered event instead of the Window.Loaded event which might help in your solution