문제

I have two methods in my windows phone app and both of them display a message box.
I can call method1 as many times as I like and the messagebox always displays correctly. However, if I then call method2 having previously called method1, I get the error:

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

Both of my methods look like this;

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

Is there anything wrong with this?
I thought my call to EndShowMessageBox should be enough but I am still getting the error.

도움이 되었습니까?

해결책

I found the issue. My code was actually causing the messagebox to open twice very quickly. I simply added a check to IsVisible and now the second box does not display.

if (!Guide.IsVisible)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top