/* * TIMELINE */ private void lbxTimeline_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_lastSelectedFixture != null) { _lastSelectedFixture.RemoveFromCanvas(canvas1); } if (lbxTimeline.SelectedItem.GetType() == typeof(string)) // hacky way of testing if user clicked "add new fixture" { addFixturePop.Show(PlacementMode.Mouse); lbxSteps.ItemsSource = null; lbxReferencePoints.ItemsSource = null; } else { RoutineFixture rf = ((RoutineFixture)lbxTimeline.SelectedItem); lbxReferencePoints.ItemsSource = rf.ReferencePoints; if (lbxSteps.ItemsSource == null) { lbxSteps.Items.Clear(); } lbxSteps.ItemsSource = rf.RoutineSteps; if (_lastSelectedStep != null) { _lastSelectedStep.RemoveFromCanvas(canvas1); } _lastSelectedFixture = rf; _lastSelectedFixture.AddToCanvas(canvas1); } }