// event for when a timestep of an anomaly was selected from the listbox private void anomalies_SelectionChanged(object sender, SelectionChangedEventArgs e) { // set current time to selected time and update FlightGear object selectedTime = (sender as ListBox).SelectedItem; if (selectedTime != null) { _researchVM.VM_CurrTimestep = (int)selectedTime; _researchVM.update(); } }