Crash when coming out of fullscreen

Jun 8, 2010 at 8:45 PM

First of all, nice job on this control. I really appreciate the work that went into it.

I am using the version timeline-49068.

I have a silverlight v4 app that has a tab control with 2 tabs. I placed the timeline control in one tab and other information in the other tab. If I leave the full screen mode and the timeline tab is NOT the active tab, an exception is thrown in TimelineBand.cs in the ResetVisibleDaysHighlight() method. The issue seems to be that VisibleDatesAreaWidth and/or VisibleDatesAreaHeight are 0.0.

I "fixed" the issue by not executing the faulting code if those values are 0.0.  It seems to work but I really have no idea what ramifications the "fix" has so...

This is what I now have for the ResetVisibleDaysHighlight method in TimelineBand.cs:

/// <summary>
///
/// </summary>
public void ResetVisibleDaysHighlight(
)
{
 if (VisibleDatesPart != null)
 {
  if (VisibleTimeSpan.Ticks == 0 || IsMainBand)
  {
   VisibleDatesPart.Visibility = Visibility.Collapsed;
  }
  //else // <--- Original line of code.
  else if (VisibleDatesAreaWidth != 0.0 && VisibleDatesAreaHeight != 0.0) // <--- What I changed it to.
  {
   VisibleDatesPart.Visibility = Visibility.Visible;
   VisibleDatesPart.Width = VisibleDatesAreaWidth;
   VisibleDatesPart.Height = VisibleDatesAreaHeight;

   VisibleDatesPart.SetValue(Canvas.LeftProperty,
    (CanvasPart.ActualWidth - VisibleDatesAreaWidth) / 2 + 1);

   VisibleDatesPart.SetValue(Canvas.ZIndexProperty, 1);
  }
 }
}