0

how to dynamically Change Background Color of the Page on timer after Page load in windows phone 7. Suppose there are 4-5 colors that need to be change after particular time.

Shaan_14
  • 51
  • 1
  • 10

1 Answers1

1

You can use DispatcherTimer for this operation.

Use the method below in your page and call it from PhoneApplicationPage_Loaded event. Suppose you have to change background color every 5 seconds,

private void ChangeBackgroundColor()
{
    DispatcherTimer dt = new DispatcherTimer();
    dt.Interval = TimeSpan.FromMilliseconds(5000);

    dt.Tick += (s, e) =>
    {
        //Code for change background color 
    };

    dt.Start();
}

This will process every 5 seconds.

Nelson T Joseph
  • 2,683
  • 8
  • 39
  • 56