You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DialogHost.Show() completes before closing animation finishes with DialogHost.Close() #4017
Is your feature request related to a problem? Please describe.
When closing a dialog using DialogHost.Close(...) (For my the most natural way to close a Dialog if you need do this for code, i don't understand the first way in wiki) after await DialogHost.Show(...), the dialog closing animation can't start if the next line of code blocks UI thread, 1 - 2 ms lines of code after .Close() actually blocks UI Thread and the closing animation doesn't start it feels unnatural until something is implemented that frees the UI thread, a combination of blocking and non-blocking UI Thread can "lag" the close animation. Feels more natural in my opinion just wait the close animation internally.
awaitDialogHost.Show(dialog);awaitTask.Delay(300);//Wait close animation for continue something, I don't know the exact time of animation but works for now
Describe the solution you'd like
Ideally, DialogHost.Show(...) should only complete after the dialog has fully closed and the closing animation has finished.
This would allow developers to write code like this without needing manual delays:
In other words, the dialog lifecycle awaited by Show() would include the closing animation timing internally.
Describe alternatives you've considered
The current workaround is to manually add a delay after Show() like i said above:
Activity
fix(DialogHost): Correct visual state type for monitoring transitions
fix(DialogHost): Improve robustness of visual state wait methods
Allow for waiting for DialogHost animations. (MaterialDesignInXAML#4083)