private void MainWindow_Loaded(object sender, RoutedEventArgs e) { try { DataContext = _viewModel = new GatewayViewModel(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }