PDA

View Full Version : [WPF] DispatcherTimer e Label con countdown


robertino_salemi
20-03-2015, 16:23
Ciao,
sto utilizzando un DispatcherTimer nel mio 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!
}


Il timer funziona, nella Label 'timerLabel' vorrei visualizzare il countdown.

Come dovrei procedere?

Grazie.