Application.Current.Shutdown() vs. Application.Current.Dispatcher.BeginInvokeShutdown()

后端 未结 3 798
灰色年华
灰色年华 2020-12-30 11:09

First a bit of background: I have a WPF application, which is a GUI-front-end to a legacy Win32-application. The legacy app runs as DLL in a separate thread. The commands th

3条回答
  •  不思量自难忘°
    2020-12-30 11:41

    MSDN page for Shutdown()
    MSDN page for BeginInvokeShutdown()

    It seems that this is just a collision of terminology. BeginInvokeShutdown shuts down that dispatcher, your application can in theory continue to live afterwards (though without a dispatcher, it'd be pretty limited). Shutdown however actually exits your application, which is what you want.

提交回复
热议问题