Example #1
0
        /// <summary>
        /// Informs the user of the current status of the migration process.
        /// </summary>
        /// <param name="migrationStep">The migration step the status applies to.</param>
        /// <param name="messageType">The type of messaging being communicated.</param>
        /// <param name="statusMessage">Status message to be sent to the user.</param>
        public async Task UpdateCurrentStatusAsync(MigrationStepEnum migrationStep, MessageTypeEnum messageType, string statusMessage)
        {
            //confirming there is a message to update.
            if (string.IsNullOrEmpty(statusMessage))
            {
                return;
            }

            //Scheduling the update of the observable collection that bound to the data grid on the dialog.
            await Dispatcher.InvokeAsync(() =>
            {
                var status = new MigrationStepStatus {
                    MessageType = messageType.GetName(), MigrationStep = migrationStep.GetName(), Status = statusMessage
                };
                StepStatus.Add(status);
            }
                                         , DispatcherPriority.Normal);
        }