When dealing with multithreading normally Presenter receives event and calls View to update the corresponding control.
Presenter:
private void EventAggregator_InfoUpdated(object sender, InfoUpdatedEventArgs e)
{
view.UpdateFeedInfo(e.FeedInfo);
}
View:
public void UpdateFeedInfo(FeedInfo feedInfo)
{
if (!control.IsHandleCreated && !control.IsDisposed) return;
control.BeginInvoke((MethodInvoker) (() => control.Update(feedInfo)));
}
My question is how to invoke a method call in presenter in the GUI thread before calling view. Something like:
private void EventAggregator_InfoUpdated(object sender, InfoUpdatedEventArgs e)
{
//InvokeInUiThread// ManageInfoInput(e.FeedInfo);
}
private void ManageInfoInput(FeedInfo feedInfo)
{
...
view.UpdateFeedInfo(e.FeedInfo);
}