Код: Выделить всё
///
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
///
public App()
{
InitializeComponent();
Suspending += OnSuspending;
#if DEBUG
this.displayRequest = new DisplayRequest();
#endif
}
///
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
///
///
/// The source of the suspend request.
///
///
/// Details about the suspend request.
///
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
deferral.Complete();
}
< /code>
Я установил точку останова на линии var deferral = e.suspendingoperation.getdeferral (); < /code> и отладка с визуальной студией. Затем я нажал кнопку «Пуск» на своем телефоне, запустил другое приложение и подождал около 10 секунд. Onsuspending Есть идеи? < /p>
Подробнее здесь: https://stackoverflow.com/questions/241 ... sing-winrt