views:

206

answers:

2

        ChildWindow1 wnd1 = new ChildWindow1();
        ChildWindow2 wnd2 = new ChildWindow2();


        wnd1.Show();

        //**Is there a way to pause thread here until wnd1 is closed???** 

        wnd2.Show();

A: 

I assume you are talking about modal child window. Yes it possible and real simple. Use Child Window control from Silverlight ToolKit @ http://silverlight.codeplex.com/.

Manoj
a) ChildWindow is part of the standard SDK not the toolkit, b) this doesn't cause the the thread to block on the call to Show which is what the OP is asking for.
AnthonyWJones
Sorry for the confusion.a) I was actually referring for Child Window sample from http://www.silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.htmlb) Yes. It doesn't cause the thread to block.
Manoj
@Manoj: a) I can see how that might have confused you, that Sample page showcases some controls from the SDK as well as toolkit controls
AnthonyWJones
+2  A: 

Use code like this:-

 ChildWindow1 wnd1 = new ChildWindow1;
 wnd1.Closed += (s, args) =>
 {
    ChildWindow2 wnd2 = new ChildWindow2;
    wnd2.Show();
 }
 wnd1.Show();

 // Note code here will run as soon as wnd1 has displayed, Show does not block.
AnthonyWJones
It seems this is a most useful solution. Thanks.
Eric Cartmenes