munna
munna

Reputation: 229

How to get all the child Windows of a current Page in WPF

I have got this situation: I have a page from which I can open multiple windows. Are there any way to detect all the windows from the current page?

Upvotes: 1

Views: 4579

Answers (1)

Binil
Binil

Reputation: 6583

try this

foreach (Window w in this.OwnedWindows)
                MessageBox.Show(w.Name.ToString());

while displaying child windows set the owner property.

Upvotes: 7

Related Questions