I am posting an event (I am using Microsoft.Practices.Prism.Events). This event will be processed elsewhere. Then I want to wait until this is processed (I don’t care where and by whom), before continuing with the code, I want the handler to put some status in my arg argument, so I can use this status (for example, successful printing or failed to print) before deciding what to do next.
Should I just start the thread and check for arg.Status (which I can configure for subscribers during processing)?
Or alternatively, if the subscriber raises another event informing that the publication is completed or something else?
public void Execute(object parameter)
{
var arg = new PrintCustomerAccountSummaryReportRequestedEventArgument { Customer = _viewModel.Customer, StartDate = _viewModel.ReportStartDate, EndDate = _viewModel.ReportEndDate };
EventManager.Instance.GetEvent<PrintCustomerAccountSummaryReportRequestedEvent>().Publish(arg);
}