Reputation: 51
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.
Upvotes: 0
Views: 266
Reputation: 2763
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.
Upvotes: 1