Sweta Sinha

Sweta Sinha

  • NA
  • 51
  • 42.2k

Timers in Windows Phone 8

Feb 24 2015 1:38 AM
Hi,
 
I am using Timer to display images after  certain time interval. 
private void setTimer()
{
DispatcherTimer dt = new DispatcherTimer();
dt.Interval = TimeSpan.FromSeconds(5);
dt.Tick += delegate
{
if (index == 0)
homepageimage.Source = listOfImages[index];
else if (index < listOfImages.Count)
{
homepageimage.Source = listOfImages[index];
}
else
index = -1;
++index;
this.fadeIn.Begin();
};
dt.Start();
}
 
Their are a total of 5 images in listOfImages.But while displaying it shows  only 3 images.I have debugged the code and according to that it is  it should show all 5.I don't know why this code is not working as expected.
 

Answers (1)