簡體   English   中英

Windows Phone XNA消息框錯誤

[英]Windows Phone XNA message box error

我的Windows Phone應用程序中有兩種方法,它們都顯示一個消息框。
我可以根據需要多次調用method1,並且消息框始終正確顯示。 但是,如果我隨后調用以前調用過method1的method2,則會收到錯誤消息:

the Guide UI is already active. Wait until Guide.IsVisible is false before issuing this call

我的兩種方法都是這樣的;

try
{
    ...
}
catch (Exception ex)
{
    Guide.BeginShowMessageBox("Error",
    "There was a problem.",
    new List<string> { "OK" }, 0, MessageBoxIcon.Alert, asyncResult => Guide.EndShowMessageBox(asyncResult), null);
}

這有什么問題嗎?
我以為我對EndShowMessageBox的調用應該足夠了,但是仍然出現錯誤。

我發現了問題。 我的代碼實際上導致消息框快速打開兩次。 我只是向IsVisible添加了一個檢查,現在第二個框不顯示。

if (!Guide.IsVisible)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM