/// <summary> /// This function is responsible for the process of receiving and checking the input /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void stopListBoxA_SelectionChanged(object sender, SelectionChangedEventArgs e) { tempStopA = (BO.LineStation)stopListBoxA.SelectedItem; stopALabel.DataContext = tempStopA; fIndex = stopListBoxA.SelectedIndex; stopAPicked = true; if (stopBPicked) { try { var a = new BO.SequentialStopInfo(); a.Distance = bl.DistanceCalculate(tempLine.Number, tempStopA.Code, tempStopB.Code); a.TravelTime = bl.TravelTimeCalculate(tempLine.Number, tempStopA.Code, tempStopB.Code); distance_Binding.DataContext = a; travel_time_Binding.DataContext = a; } catch (Exception) { MessageBox.Show("Please enter information about the distance and travel time between the following stations: " + bl.GetNameByStopCode(tempStopA.Code) + " " + bl.GetNameByStopCode(tempStopB.Code)); } } }