public ShellController(
            [NotNull] UiContext uiContext,
            [NotNull] IPersistApplicationState statePersistence)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException("uiContext");
            }

            if (statePersistence == null)
            {
                throw new ArgumentNullException("statePersistence");
            }

            MessengerInstance = uiContext.Messenger;
            MessengerInstance.Register<ShutdownMessage>(this, OnShutdownRequested);
            MessengerInstance.Register<ShellDialogRequestMessage>(this, OnDialogRequested);
            MessengerInstance.Register<ApplicationStateRequestedMessage>(this, OnApplicationStateRequested);
            MessengerInstance.Register<ApplicationStateLoadedMessage>(this, OnApplicationStateLoaded);
            this.statePersistence = statePersistence;
            this.uiContext = uiContext;
            BackgroundJob = uiContext.BackgroundJob;

            LedgerBookDialog = new ShellDialogController();
            DashboardDialog = new ShellDialogController();
            TransactionsDialog = new ShellDialogController();
            BudgetDialog = new ShellDialogController();
            ReportsDialog = new ShellDialogController();
        }
Example #2
0
        public ShellController([NotNull] UiContext uiContext, [NotNull] IDashboardService dashboardService, IPersistApplicationState statePersistenceProvider)
        {
            if (uiContext == null) throw new ArgumentNullException(nameof(uiContext));
            if (dashboardService == null) throw new ArgumentNullException(nameof(dashboardService));

            this.uiContext = uiContext;
            this.dashboardService = dashboardService;
            this.statePersistence = statePersistenceProvider;
            // this.persistenceOperations = persistenceOperations;
        }
        public ShellController([NotNull] UiContext uiContext, [NotNull] IDashboardService dashboardService, IPersistApplicationState statePersistenceProvider)
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }
            if (dashboardService == null)
            {
                throw new ArgumentNullException(nameof(dashboardService));
            }

            this.uiContext        = uiContext;
            this.dashboardService = dashboardService;
            this.statePersistence = statePersistenceProvider;
            // this.persistenceOperations = persistenceOperations;
        }
        public ShellController(
            [NotNull] IUiContext uiContext,
            [NotNull] IPersistApplicationState statePersistence,
            [NotNull] PersistenceOperations persistenceOperations
            )
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

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

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

            MessengerInstance = uiContext.Messenger;
            MessengerInstance.Register <ShellDialogRequestMessage>(this, OnDialogRequested);
            MessengerInstance.Register <ApplicationStateRequestedMessage>(this, OnApplicationStateRequested);
            MessengerInstance.Register <ApplicationStateLoadedMessage>(this, OnApplicationStateLoaded);

            this.statePersistence      = statePersistence;
            this.persistenceOperations = persistenceOperations;
            this.uiContext             = uiContext;

            LedgerBookDialog   = new ShellDialogController();
            DashboardDialog    = new ShellDialogController();
            TransactionsDialog = new ShellDialogController();
            BudgetDialog       = new ShellDialogController();
            ReportsDialog      = new ShellDialogController();
        }
Example #5
0
        public ShellController(
            [NotNull] IUiContext uiContext,
            [NotNull] IPersistApplicationState statePersistence,
            [NotNull] PersistenceOperations persistenceOperations
            )
        {
            if (uiContext == null)
            {
                throw new ArgumentNullException(nameof(uiContext));
            }

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

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

            MessengerInstance = uiContext.Messenger;
            MessengerInstance.Register<ShellDialogRequestMessage>(this, OnDialogRequested);
            MessengerInstance.Register<ApplicationStateRequestedMessage>(this, OnApplicationStateRequested);
            MessengerInstance.Register<ApplicationStateLoadedMessage>(this, OnApplicationStateLoaded);

            this.statePersistence = statePersistence;
            this.persistenceOperations = persistenceOperations;
            this.uiContext = uiContext;

            LedgerBookDialog = new ShellDialogController();
            DashboardDialog = new ShellDialogController();
            TransactionsDialog = new ShellDialogController();
            BudgetDialog = new ShellDialogController();
            ReportsDialog = new ShellDialogController();
        }