The second call shows dialog for a frame of a second, then it automatically closes, but the interface still looks like "blocked" and the only way to get rid of this is to rerun the program.
After digging inside of the second Show calls, I've found out, that it throws an exception in DialogHost.cs class after list.Count == 0 check on this method:
private static DialogHost.DialogHost GetInstance(string? dialogIdentifier)
{
if (DialogHost.DialogHost.LoadedInstances.Count == 0)
throw new InvalidOperationException("No loaded DialogHost instances.");
List<DialogHost.DialogHost> list = DialogHost.DialogHost.LoadedInstances.Where<DialogHost.DialogHost>((Func<DialogHost.DialogHost, bool>) (dh => dialogIdentifier == null || object.Equals((object) dh.Identifier, (object) dialogIdentifier))).ToList<DialogHost.DialogHost>();
if (list.Count == 0)
throw new InvalidOperationException("No loaded DialogHost have an Identifier property matching dialogIdentifier ('" + dialogIdentifier + "') argument.");
return list.Count <= 1 ? list[0] : throw new InvalidOperationException("Multiple viable DialogHosts. Specify a unique Identifier on each DialogHost, especially where multiple Windows are a concern.");
}
I should also mention, that if I manually set some delay between dialog's calls this way:
When I call
DialogHost.Show
method this way to open dialogs one by one (this
is aViewModel
of dialog to show):The second call shows dialog for a frame of a second, then it automatically closes, but the interface still looks like "blocked" and the only way to get rid of this is to rerun the program. After digging inside of the second
Show
calls, I've found out, that it throws an exception inDialogHost.cs
class afterlist.Count == 0
check on this method:I should also mention, that if I manually set some delay between dialog's calls this way:
Then it works as expected.