Question

I want to display a sequence of images in the canvas on my Silverlight application. However, silverlight takes all my commands and images and displays the last image. I believe this is because of the lose focus feature of Silverlight, but I am not able to solve this problem. I have tried using Thread.Sleep() and DispatcherTimer() but they don't seem to work (my implementation, given below, of it could be wrong).

for(int i =0; i < number; i++)

{ Canvas.SetTop(value1); Canvas.SetLeft(value2); Thread.Sleep(7000); }

Thanks in advance.

Was it helpful?

Solution

The solution I implemented was the use of two threads. One BackgroundWorker that held the images and then sent the images to the Dispatcher or main thread that displayed it. The Background worker was made to sleep after each call to the dispatcher thread.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top