public MainWindow(IMainWindowViewModel mainWindowViewModel) { try { InitializeComponent(); if (mainWindowViewModel == null) { throw new ArgumentNullException(nameof(mainWindowViewModel)); } _MainWindowViewModel = mainWindowViewModel; _MainWindowViewModel._MainWindowModel.PropertyChanged += _MainWindowModel_PropertyChanged; DataContext = _MainWindowViewModel; if (_MainWindowViewModel._MainWindowModel.Algorithms.Count < 1) { _MainWindowViewModel.ShowErrorMessage("No Algorithms Found - Please close the application and create one or more Algorithms."); _MainWindowViewModel.EnableInput(false); } } catch (Exception ex) { //Logging Here } }