public MainWindowViewModel(Model theModel) { _theModel = theModel; _theModel.NbInfoFoundEvent += HandleNbInfoFoundEvent; FoundDevices = new ObservableCollection<IPAddress>(); FoundConfigRecords = new ObservableCollection<NbConfigRecord>(); InitTimer(); }
protected override void OnStartup(StartupEventArgs e) { try { base.OnStartup(e); MainWindow window = new MainWindow(); var main_model = new Model(); _mainWindowVm = new MainWindowViewModel(main_model); window.DataContext = _mainWindowVm; window.Closed += ApplicationQuitting; window.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); Current.Shutdown(); } }