Iam getting the exception as mentioned below. Can u pls solve this issue.
private void textloaded(object sender, RoutedEventArgs e) //Added tyhis function to access textblock in datatemplate.
{
TextBlock tb = (TextBlock)sender;
tb.Visibility = Visibility.Visible; //exception at this line.
}
void dispatcherTimer_Tick(object sender, object e)
{
DateTimeOffset time = DateTimeOffset.Now;
TimeSpan span = time - lastTime;
lastTime = time;
timesTicked++;
if (timesTicked == 10)
{
RoutedEventArgs routedEventArgs = new RoutedEventArgs();
textloaded(sender, routedEventArgs);
}
if (timesTicked > timesToTick)
{
stopTime = time;
dispatcherTimer.Stop();
span = stopTime - startTime;
}
}
syamala.