Exemplo n.º 1
0
 public MainWindowViewModel(Model theModel)
 {
     _theModel = theModel;
     _theModel.NbInfoFoundEvent += HandleNbInfoFoundEvent;
     FoundDevices = new ObservableCollection<IPAddress>();
     FoundConfigRecords = new ObservableCollection<NbConfigRecord>();
     InitTimer();
 }
Exemplo n.º 2
0
        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();
            }
        }