using DTS.Common.Utilities.Logging; using Microsoft.Practices.Prism.Events; using Microsoft.Practices.ServiceLocation; using System; namespace DTS.Common.Events { /// /// Event to inform app that it should mark itself busy or available /// /// /// /// public class PageErrorEvent : CompositePresentationEvent { /// /// surfaces an error to the application, if applicable /// http://manuscript.dts.local/f/cases/28312/Surface-Read-does-not-match-write-to-user /// /// public static void SurfaceApplicationError(string msg) { try { var eventAggregator = ServiceLocator.Current.GetInstance(); eventAggregator.GetEvent().Publish(new PageErrorArg(new[] { msg }, null)); } catch (Exception ex) { APILogger.Log(ex); } } } public class PageErrorArg { public string [] Errors { get; } public object Page { get; } public bool Handled { get; set; } public PageErrorArg(string[] errors, object page) { Errors = errors; Page = page; } } }