0

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.

1
  • Can you show the stuff inside the try block. Hard to tell a problem in code without the code causing the problem. Commented May 7, 2014 at 19:07

1 Answer 1

4

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.