Attempting to load from an in-memory XML string

Feb 19, 2010 at 11:23 PM

I am building my XML string on-the-fly in the code-behind.  If I call ClearEvents() and ResetEvents() immediately after my page/control is loaded, I receive an error.  However, if I put a button on the page, and call ClearEvents() and ResetEvents() when the button is clicked, it works great, and my events are displayed.  I'm using SL4 beta with VS2010, and I rebuilt the TImeLine control as well. Any idea why loading the data immediately after the page is loaded would generate an error?

The code that is generating the error is in TimelineBand.cs:

<font face="Consolas" size="2"><font face="Consolas" size="2">

m_calc.TimelineEvents =

</font></font><font face="Consolas" size="2">

 

</font>

value;

m_calc seemes to be NULL at this point.  I'm not specifying any URLs in the XAML, as my XML will be build on-the-fly.

Coordinator
Feb 22, 2010 at 8:50 PM

Look at the SilverlightNews example, it also loads events without button using ClearEvents/ResetEvents.

Feb 26, 2010 at 2:01 AM

Seems to be a bug in the timeline control.  If a button is required, it introduces a delay until the user clicks the button, then performs the ClearEvents() / ResetEvents().  In the SilverlightNews, a delay is also introduced while fetching the data that builds the XML in memory.  However, if there is no delay, and the methods are called immediately after the page is loaded, the error occurs (m_calc = NULL).  Perhaps there is a timing issue in that the timeline control has not yet fully initialized?

Coordinator
Mar 3, 2010 at 7:33 PM

TimelineReady event will resolve this issue also.