shanmugharaj
shanmugharaj

Reputation: 3924

Window shown as dialogue losts its focus - wpf

I have a main window Say home and from there i am calling another window named addItem as

var item = new addItem();
item.ShowDialog();

Its working fine. But when we navigate to other applications like chrome, notepad by alt + tab and come back to the WPF application both the windows are separated meaning as like in winforms it wont stick together

So user got confused in that behavior.

Requirement is unless until the dialogue window is opened it should always be on top and main window on the back and when we click the icon in task bar both window together should come.

Upvotes: 0

Views: 54

Answers (1)

Vinkal
Vinkal

Reputation: 2984

try this

 var item = new addItem();
 item.Owner = this;
 item.ShowDialog();

Upvotes: 2

Related Questions