亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用WinRT不引發掛起事件

使用WinRT不引發掛起事件

一只甜甜圈 2019-07-11 10:40:26
使用WinRT不引發掛起事件我在WindowsPhone 8.1上使用WinRT掛起事件有問題,它不會觸發。我也不知道原因。這是我的密碼:/// <summary>/// 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()./// </summary>public App(){    InitializeComponent();    Suspending += OnSuspending;#if DEBUG    this.displayRequest = new DisplayRequest();#endif}/// <summary>/// 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./// </summary>/// <param name="sender">/// The source of the suspend request./// </param>/// <param name="e">/// Details about the suspend request./// </param>private void OnSuspending(object sender, SuspendingEventArgs e){    var deferral = e.SuspendingOperation.GetDeferral();    deferral.Complete();}我在線路上設置了一個斷點var deferral = e.SuspendingOperation.GetDeferral();并使用VisualStudio對其進行了調試。然后我按下手機上的“開始”按鈕,運行另一個應用程序,等待大約10秒。OnSuspending不是逃跑。有什么想法嗎?
查看完整描述

3 回答

?
慕絲7291255

TA貢獻1859條經驗 獲得超6個贊

我不知道你為什么要我給你看證據鏈接-不難找到MSDN博客->“如何調試流程生命周期事件”,它說:如果您想通過在每個處理程序中設置一個斷點并按F5在VisualStudio中啟動調試器來調試前面部分的代碼,那么即使應用程序來回切換到屏幕上,您也將永遠等待它們觸發!原因很簡單:在調試應用程序時,Windows不會將其掛起。

查看完整回答
反對 回復 2019-07-11
?
月關寶盒

TA貢獻1772條經驗 獲得超5個贊

我花了好幾個小時才找到這個金塊。TBF我并不知道我在尋找什么-我的癥狀(我在谷歌上搜索)是“Windows Phone應用程序崩潰,但不是在調試模式下調試”-也許留下這條評論將幫助Google鏈接到其他搜索同樣事情的人這個很好的答案。這個答案不能解決問題,但它可以幫助您識別問題。 

查看完整回答
反對 回復 2019-07-11
  • 3 回答
  • 0 關注
  • 651 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號