private void OnNewErrorMessageReceived(ErrorMessageReceived message)
 {
     // Add this new error to the observable collection.
     ErrorMessageDetails newError = new ErrorMessageDetails()
     {
         MessageId = message.OriginalMessageId,
         MessageXml = message.Body,
         ProcessingFailedAddress = message.ProcessingFailedAddress,
         TimeSent = message.ErrorReceivedTime,
         WindowsIdentity = message.Identity,
         ExceptionInformation = message.ExceptionInformation
     };
     errorMessages.Add(newError);
 }
        private void LoadErrorMessages()
        {
            // read from the persistent store and display the list of error messages.

            ReadOnlyCollection<IErrorMessageDetails> errorList = errorPersistenceStore.ErrorMessages;
            foreach (IErrorMessageDetails errorMessage in errorList)
            {
                ErrorMessageDetails detail = new ErrorMessageDetails
                {
                    MessageId = errorMessage.OriginalMessageId,
                    MessageXml = errorMessage.Body,
                    ProcessingFailedAddress = errorMessage.ProcessingFailedAddress,
                    TimeSent = errorMessage.ErrorReceivedTime,
                    WindowsIdentity = errorMessage.Identity,
                    ExceptionInformation = errorMessage.ExceptionInformation
                };

                errorMessages.Add(detail);

            }
        }