dll中的窗口应该如何封装

            Thread t = new Thread(()=>
            {
                var win = new System.Windows.Window();
                win.Content = new System.Windows.Controls.TextBox();
                win.ShowDialog();
                win.Closed += (s, e) =>
               {
                   System.Windows.Threading.Dispatcher.ExitAllFrames();
               };
                System.Windows.Threading.Dispatcher.Run();
            });
            t.SetApartmentState(ApartmentState.STA);
            t.Start();

posted @ 2021-08-05 16:11  马肯尼煤牙巴骨  阅读(59)  评论(0编辑  收藏  举报