有没有办法同步Silverlight子窗口(使其像MessageBox)?

时间:2010-03-31 09:28:26

标签: c# silverlight multithreading childwindow


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


        wnd1.Show();

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

        wnd2.Show();

2 个答案:

答案 0 :(得分:3)

使用这样的代码: -

 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.

答案 1 :(得分:-1)

我假设你在谈论模态子窗口。是的,可能而且非常简单。使用Silverlight ToolKit @ http://silverlight.codeplex.com/中的子窗口控件。