-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
What steps will reproduce this issue?
We have a MetroDialog that when closed triggers an asynchronous operation that causes another MetroDialog to briefly get shown and then removed again.
Flashing dialogs like that is of course not a desireable behavior on our applications part and we are on it, but it uncovered a race condition in MahApps that I think ought to be fixed.
Depending on timing in ShowMetroDialogAsync and HideMetroDialogAsync, sometimes the original dialog is never removed from screen and that call to HideMetroDialogAsync never completes.
We have tracked down the problem to BaseMetroDialog._WaitForCloseAsync(), where the closingStoryboard.Completed event is never triggered, so the task never completes.
I would guess the storyboard is interrupted or suchlike due to the moving around of the dialog in the visual tree (metroActiveDialogContainer <--> metroInactiveDialogContainer)?
A workaround is to set DialogSettings.AnimateHide=false on the dialog (a related issue seems to be #2735).
--
Environment
- MahApps.Metro v1.3.0
- Windows 10
- Visual Studio 2015
- .NET Framework 4.6