I am developing a UI program in C# WPF .NET3.5. In my main window, I have a button. When the user clicks on this button it creates a modeless dialog. Changing the focus back to main window and clicking the button again creates another modeless dialog. The sequence of dialogs is as below:
M -> C1 -> C2 -> C3
where M is the main window, C1, C2 and C3 are child windows in the order. C1 is modeless (created using Window.Show() method with Owner property not set) and C2 and C3 are modal (created using Window.ShowDialog() method with Owner property set). What I expect is that user should be able to create multiple C1, C2 and C3 dialogs from M.
My problem is as follows. If I create 2 C1 dialogs, everything works fine. I can perform all UI operations in M and the two C1 dialogs. However, once C2 and C3 dialogs are created from one C1 dialog, I cannot perform any UI operations in another C1 dialog and M dialog. I can however perform UI operations in C3 dialog.
C2 dialog contains a progress bar which is updated using DispatcherTimer. After the operations in progress are completed, C3 dialog is launched from event handler of DispatcherTimer.
I thank you in advance for your valuable support.
You will need to find another way to set C2 and C3 to be always on top, outside of using modal dialogs.
From MSDN:
Try setting the TopMost property of C2 and C3 to true and use
Window.Show()instead ofWindow.ShowDialog().