private void OnItemCollapsed(object sender, RoutedEventArgs e)
{
Expander expander = (Expander)sender;
Expander source = e.OriginalSource as Expander;
if (source != null && source != expander)
{
// bugbug: for some reason WPF also sends collapse event to all the parents
// but we want to ignore those.
return;
}
ListView childView = expander.Content as ListView;
if (childView != null)
{
childView.ItemsSource = null;
}
// todo: remove the graphs...
}