The calling thread must be STA, because many UI components require this in WPF

后端 未结 2 1100
南旧
南旧 2020-11-27 07:27

My scenario:

   void Installer1_AfterInstall(object sender, InstallEventArgs e)
    {
        try
        {         

              MainWindow ObjMain = new          


        
2条回答
  •  -上瘾入骨i
    2020-11-27 08:05

    I had that error before and the easiest way is using Dispatcher.
    See my Question and answer

    Good Luck

提交回复
热议问题