Search code examples
c#silverlightmultithreadingchildwindow

Is there a way to synchronize Silverlight Child Window (make it like MessageBox)?



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


        wnd1.Show();

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

        wnd2.Show();


Solution

  • 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.