Pregunta

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.

¿Fue útil?

Solución

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)
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top