private void timerCall_Elapsed(object sender, ElapsedEventArgs e)
{
try
{
if (this.Dispatcher.Thread != System.Threading.Thread.CurrentThread)
{
this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal,
new EventHandler<ElapsedEventArgs>(this.timerCall_Elapsed), sender, new object[] { e });
return;
}
if (this.avHistoryEvent != null)
{
TimeSpan duration = (DateTime.Now - this.avHistoryEvent.StartTime);
this.labelDuration.Content = string.Format("{0:D2}:{1:D2}:{2:D2}", duration.Hours, duration.Minutes, duration.Seconds);
}
}
catch (TargetInvocationException ex)
{
LOG.Error(ex);
}
}