I have a small WPF application, say SubWPF , which initially displays a home window that allows the user to browse a file. I am launching this wpf application on the button click of another application say MainWPF. In short, when I click on "Launch Sub", SubWPF.exe is launched from MainWPF through Process class as given below.
Process p = new Process();
p.StartInfo.FileName = "SubWPF.exe";
p.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
p.StartInfo.UseShellExecute = false;
p.StartInfo.Verb = "runas";
p.Start();
The issue is in the background I have the MainWPF window. I need the subwpf to be always on top and prevent the user from clicking background buttons of mainwpf. To be precise, the behaviour of a showdialog() needs to be achieved. I cannot use TopMost=true
for my subwpf as once the user selects a file in the home window, this window is closed and another window showing the contents of file is displayed. Setting TopMost=true
is not allowing me to close the file selection window.