private void ComboVans_SelectionChanged(object sender, SelectionChangedEventArgs e) { VanViewModel o = this.DataContext as VanViewModel; o.Station.SelectedVan = o.Vans.Find((item) => item.Number == Int16.Parse(o.SelectedVanNumber)); this.DataContext = o; }
private void GetVans_Click(object sender, RoutedEventArgs e) { VanViewModel o = this.DataContext as VanViewModel; try { this.ComboVans.ItemsSource = o.loadVans(o.Station.SelectedTrain); } catch { this.ComboVans.ItemsSource = new List <VanModel>() { }; } Deb.Print(o.Station.SelectedVan, "selected train from vans"); }