WPF Application still runs in background after closing

前提是你 提交于 2019-11-28 23:01:42
Kent Boogaart

What is your shutdown mode? If it's explicit, then it's because you're not explicitly shutting down. If it's main window, it's because you've not assigned the main window to Application.MainWindow.

Shivanhsu Verma

Write this code on application closing button:

Application.Current.Shutdown()
Shadrack Kimutai

alternatively, add this to your App.cs

public App()
    {
        ShutdownMode = ShutdownMode.OnLastWindowClose;
    }

Detailed explanation here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!