Inheritance: Rees.Wpf.ControllerBase, IShellDialogInteractivity
        // TODO Are two images on the medium sized widgets still required?

        public DashboardController(
            [NotNull] IUiContext uiContext,
            [NotNull] IDashboardService dashboardService,
            [NotNull] IApplicationDatabaseService applicationDatabaseService)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

            if (dashboardService == null)
            {
                throw new ArgumentNullException(nameof(dashboardService));
            }

            if (applicationDatabaseService == null)
            {
                throw new ArgumentNullException(nameof(applicationDatabaseService));
            }

            this.chooseBudgetBucketController = uiContext.ChooseBudgetBucketController;
            this.createNewFixedBudgetController = uiContext.CreateNewFixedBudgetController;
            this.createNewSurprisePaymentMonitorController = uiContext.CreateNewSurprisePaymentMonitorController;
            GlobalFilterController = uiContext.GlobalFilterController;

            this.uiContext = uiContext;
            this.dashboardService = dashboardService;

            this.chooseBudgetBucketController.Chosen += OnBudgetBucketChosenForNewBucketMonitor;
            this.createNewFixedBudgetController.Complete += OnCreateNewFixedProjectComplete;
            this.createNewSurprisePaymentMonitorController.Complete += OnCreateNewSurprisePaymentMonitorComplete;

            CorrelationId = Guid.NewGuid();

            RegisterForMessengerNotifications(uiContext.Messenger);
        }
        // TODO Are two images on the medium sized widgets still required?

        public DashboardController(
            [NotNull] IUiContext uiContext,
            [NotNull] IDashboardService dashboardService,
            [NotNull] IApplicationDatabaseService applicationDatabaseService)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

            if (dashboardService == null)
            {
                throw new ArgumentNullException(nameof(dashboardService));
            }

            if (applicationDatabaseService == null)
            {
                throw new ArgumentNullException(nameof(applicationDatabaseService));
            }

            this.chooseBudgetBucketController              = uiContext.ChooseBudgetBucketController;
            this.createNewFixedBudgetController            = uiContext.CreateNewFixedBudgetController;
            this.createNewSurprisePaymentMonitorController = uiContext.CreateNewSurprisePaymentMonitorController;
            GlobalFilterController = uiContext.GlobalFilterController;

            this.uiContext        = uiContext;
            this.dashboardService = dashboardService;

            this.chooseBudgetBucketController.Chosen                += OnBudgetBucketChosenForNewBucketMonitor;
            this.createNewFixedBudgetController.Complete            += OnCreateNewFixedProjectComplete;
            this.createNewSurprisePaymentMonitorController.Complete += OnCreateNewSurprisePaymentMonitorComplete;

            CorrelationId = Guid.NewGuid();

            RegisterForMessengerNotifications(uiContext.Messenger);
        }
Esempio n. 3
0
 private static void OnAddNewSurprisePaymentMonitorWidgetCommandExecute(Guid correlationId)
 {
     CreateNewSurprisePaymentMonitorController.ShowDialog(BudgetAnalyserFeature.Dashboard, correlationId);
 }