Feb 29, 2012 at 12:09 PM
Edited Feb 29, 2012 at 12:10 PM
I've noticed a little weird behavior in the operation of ResetEvents when used in WPF.
I have a simple app using loop to create a list of TimelineEvent objects. I add these to the timeline by calling ResetEvents(list). I noticed that no events were getting plotted on the control. So i stepped throught he code following the call to ResetEvents(List<TimelineEvent>)
public void ResetEvents(
// fix event dates
foreach (TimelineEvent e in events)
e.EndDate = e.StartDate;
When the method is called, the "events" parameter is fully populated with the list I created in the loop. As soon as m_events.Clear() is called the list "events" is zeroized. So when the foreach loop starts there is nothing to iterate and the loop ends
Any ideas why a m_events.Clear() call would cause the parameter to the ResetEvents method to be cleared also?
So in debugging I set up the app to use a simple XML (Monet.xml) data source (i.e. not the dynamically created List<TimelineEvent>) and it renders the events just fine.