Is this an acceptable approach to update WPF MainWindow from an async task, using events thrown from a public static class?
In MainWindow.cs, I subscribe to UI.TaskCompleted event In UI.cs, I subscribe to AsyncTaskActions.TaskCompleted event.
Using this pattern, AsyncTaskActions.TaskCompleted is raised with a async task is completed. UI catch the event and raise UI.TaskCompleted. This way, the event is catch in MainWindow code where I can use Displacher.Invoke to refresh the displayed page. The end result is I get a page refresh when a task is completed and the task still runs asychronously.
Application design summary:
MainWindow: main window which can have several different page classes in content area within the main window.
Common.cs public static class contains a number of common methods through the UI in the application.
AsyncTaskActions.cs - class with a number of async common methods (ie download file)