public StationViewInfo(BO.Station station) { InitializeComponent(); try { if (station == null) { return; } _currStation = myBL.GetStation(station.Code); } catch (BO.BadStationException ex) { MessageBox.Show("Error: " + ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } textBoxStationInfo.Text = _currStation.ToString(); myLineList = new ObservableCollection <BO.Line>(_currStation.LinesPassBy); lvLinesPassBy.ItemsSource = myLineList; myAdjacentStationsList = new ObservableCollection <BO.AdjacentStations>(_currStation.MyAdjacentStations); lvAdjacentStationsList.ItemsSource = myAdjacentStationsList; }
void refreshMe(int code) { _currStation = myBL.GetStation(code); textBoxStationInfo.Text = _currStation.ToString(); }