//show the FRED add instrument window private void AddInstrumentFredBtn_OnClick(object sender, RoutedEventArgs e) { var window = new AddInstrumentFredWindow(_client); window.ShowDialog(); if (window.ViewModel.AddedInstruments != null) { foreach (Instrument i in window.ViewModel.AddedInstruments) { ViewModel.Instruments.Add(i); } window.Close(); } }
//show the FRED add instrument window private void AddInstrumentFredBtn_OnClick(object sender, RoutedEventArgs e) { using (var context = new MyDBContext()) { var window = new AddInstrumentFredWindow(context); if (window.AddedInstruments != null) { foreach (Instrument i in window.AddedInstruments) { Instruments.Add(i); } window.Close(); } } }