private void busList_SelectionChanged(object sender, SelectionChangedEventArgs e) { switch (lineOptions.SelectedItem as string) { case "TRAVELING": a = bl.GetAllLinesDriving().ToList(); break; case "NOT_TRAVELING": a = bl.GetAllLinesNotDriving().ToList(); break; } if (au == "PASSENGER") { foreach (BO.Line line in a) { line.Show = BO.status.REFULING; } } else { foreach (BO.Line line in a) { line.Show = BO.status.READY_FOR_DRIVE; } } lineList.ItemsSource = a; lineList.Items.Refresh(); }