A MessageBase message object that broadcasts to subscribed components that the application is about to save user state data. In response to this message a subscribed component should add any data it wishes to persist. Persistent data is not additive, if no data is added any existing persisted data is lost.
Наследование: GalaSoft.MvvmLight.Messaging.MessageBase
Пример #1
0
        private void OnApplicationStateRequested(ApplicationStateRequestedMessage message)
        {
            var shellPersistentStateV1 = new ShellPersistentState
            {
                Size = WindowSize,
                TopLeft = WindowTopLeft
            };
            message.PersistThisModel(shellPersistentStateV1);

            var dataFileState = this.persistenceOperations.PreparePersistentStateData();
            message.PersistThisModel(dataFileState);
        }
Пример #2
0
 private void OnApplicationStateRequested(ApplicationStateRequestedMessage message)
 {
     var widgetStates = this.dashboardService.PreparePersistentStateData();
     message.PersistThisModel(widgetStates);
 }
Пример #3
0
 /// <summary>
 ///     This method will persist the application state. Application State is user preference settings for the application,
 ///     window, and last loaded file.
 ///     Any data that is used for Budgets, reconciliation, reporting belongs in the Application Database.
 /// </summary>
 public void SaveApplicationState()
 {
     var gatherDataMessage = new ApplicationStateRequestedMessage();
     MessengerInstance.Send(gatherDataMessage);
     this.statePersistence.Persist(gatherDataMessage.PersistentData);
 }