5
Answers

How can I find out that a UserControl is Rendered ?

Razvan Adrian

Razvan Adrian

12y
2.4k
1
I have the following code from inside the UserControl.cs:

        public void wait()
        {
            int i = 0;
            while (i < 10)
            {
                i++;
                System.Threading.Thread.Sleep(1000);
            }
        }

        private void IsLoaded(object sender, RoutedEventArgs e)
        {
                wait();
        }


I just want to wait 10 seconds AFTER the layout is rendered(you can see the buttons).

If i execute the code now, it will first wait 10 seconds and then it will render the layout.
I already tried with IsLoaded event for UserControl as you can see in the text and it is not working.

Answers (5)