I'm using popup to show my user control. I want to detect when the popup is REALLY shown up on the screen, then I show the progress bar, do some work, then hide the progress bar
MyDialog dialog = new MyDialog();
myPopup.Child = dialog;
myPopup.IsOpen = true;
dialog.progressLoading.Visibility = Visibility.Visible;
Thread.Sleep(3000)
dialog.progressLoading.Visibility = Visibility.Collapsed;
However, I realize that IsOpen = true
doesnot show the popup instantly. The fact is that I must wait 3 seconds for it to show up.
How to know when popup shows up ?