views:

82

answers:

1

Hi, I have a slideshow application where i want to wait a certain amount of seconds, then show my front page, then wait again, then show next page, and so on. My problem is that when i use Thread.Sleep in between, the UI arent updated, it just sits there waiting and i only see my last control (after the full amount of time has passed (i.e all the sleeps). Any solutions for doing this?

 Thread.Sleep(1000);
            ChangeContent(new FrontPage());
            Thread.Sleep(5000);
            ChangeContent(new HtmlPage());

Pre WPF i would just use the Application.DoEvents.

+3  A: 

Use a DispatcherTimer.

HTH, Kent

Kent Boogaart