public WpfStartupManager(ICacheManager cacheManager, IDialogManager dialogManager, ISpecialDialogManager specialDialogManager) : base(cacheManager) { UiRoot.Main = new UiRoot(dialogManager, specialDialogManager); // This is the main UserError handler so that when the MainWindow is not yet existing, or no longer existing, we can handle usererrors // TODO: We should re-evaluate if handling UserErrors before or after the MainWindow is useful, or that they should either be handled differently // or that we should make sure that such errors can only occur during the life cycle of the MainWindow? _wpfErrorHandler = new WpfErrorHandler(dialogManager, specialDialogManager); UserError.RegisterHandler(x => _wpfErrorHandler.Handler(x)); }