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();

原文地址:https://www.cnblogs.com/nocanstillbb/p/15103818.html