none
程序关闭的时候为什么没有调用OnSuspending RRS feed

答案

  • 你好,

    我查了下,貌似关闭程序的时候是没有对应的Event,请查看: Application lifecycle 文档中的 App Close那一段:

    There's no special event to indicate that the user has closed an app.

    同样,也不是没有办法:

    If your app needs to do something different when it is closed by the user than when it is closed by the OS, you can use the activation event handler to determine whether the app was terminated by the user or by the OS. See the descriptions of ClosedByUser and Terminated states in the docs for the ApplicationExecutionState enumeration.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    2014年6月9日 6:35
    版主