Fix incorrect event order.

This commit is contained in:
Dean Herbert 2017-03-02 17:41:33 +09:00
parent 68857b573d
commit 963117f07d
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
1 changed files with 7 additions and 7 deletions

View File

@ -20,15 +20,14 @@ public void Push(PopupDialog dialog)
{
if (dialog == currentDialog) return;
State = Visibility.Visible;
dialogContainer.Add(dialog);
dialog.Show();
dialog.StateChanged += onDialogOnStateChanged;
currentDialog?.Hide();
currentDialog = dialog;
dialogContainer.Add(currentDialog);
currentDialog.Show();
currentDialog.StateChanged += onDialogOnStateChanged;
State = Visibility.Visible;
}
private void onDialogOnStateChanged(OverlayContainer dialog, Visibility v)
@ -38,6 +37,7 @@ private void onDialogOnStateChanged(OverlayContainer dialog, Visibility v)
//handle the dialog being dismissed.
dialog.Delay(PopupDialog.EXIT_DURATION);
dialog.Expire();
if (dialog == currentDialog)
State = Visibility.Hidden;
}