it happens if ShowAsync() is called when a MessageDialog is already open. Probally your method
ShowMessageBox is called twice.
what you can do to delay the second:
private SemaphoreSlim _semaphore = new SemaphoreSlim(1);
async void ShowMessageBox(string msgstr, string msgtitle, Boolean bConnectiomStatus)
{
if (msgstr == null)
msgstr = "";
if (msgtitle == null)
msgtitle = "";
await _semaphore.WaitAsync();
MessageDialog md = new MessageDialog(msgstr, msgtitle);
bool? result = null;
md.Commands.Add(new UICommand("OK", new UICommandInvokedHandler((cmd) => result = true)));
await md.ShowAsync();
if (result == true)
{
md.ShowAsync().Cancel();
if (bConnectiomStatus)
{
UpdateConnectionStatus(_session.User.Name, "Connected");
}
else
UpdateConnectionStatus(_session.User.Name, "Not Connected");
}
_semaphore.Release();
}
Microsoft Certified Solutions Developer - Windows Store Apps Using C#