public MainWindow(ViewModel.MainWindowViewModel viewModel) { try { InitializeComponent(); DataContext = viewModel; } catch (Exception ex) { Debugger.Break(); } }
protected override void OnStartup(StartupEventArgs e) { try { base.OnStartup(e); ViewModel.MainWindowViewModel viewModels = new ViewModel.MainWindowViewModel(); Window window = new MainWindow(viewModels); window.Show(); } catch (Exception ex) { Debugger.Break(); } }