Roberto Salemi

Roberto Salemi

  • NA
  • 146
  • 142k

[WPF] DispatcherTimer and upgrade label

Mar 20 2015 12:22 PM
Hi,

I'm using a DispatcherTimer in my UserControl:

DispatcherTimer dispatcherTimer = new DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
dispatcherTimer.Interval = new TimeSpan(0, 0, 60);
dispatcherTimer.Tick += timer_Tick;
dispatcherTimer.Start();

private void dispatcherTimer_Tick(object sender, EventArgs e)
{
CommandManager.InvalidateRequerySuggested();

myOtherUserControl uc = VisualTreeHelpers.FindChild<myOtherUserControl>(this);

uc.SearchByTimer();

//uc.timerLabel.Text = label_to_do_refresh!
}
The timer works, but I would show the countdown in timerLabel.

How can I procede?



Thanks.


Answers (1)