public void LaunchWorkItem <T>() where T : Workitem { if (_currentWorkItem is T) { return; } Workitem workitem = Container.Resolve <T>(); _currentWorkItem?.Terminate(); _currentWorkItem = workitem; workitem.Run(); }
/// <summary> /// Run the workitem /// Workitem.Run should be called from here only /// </summary> protected async Task RunWorkitem() { await Application.Current.Dispatcher.InvokeAsyncIfNeeded(async() => { if (ShouldOpenModal) { Channel = await Workitem.RunModal().ConfigureAwait(false); } else { Channel = await Workitem.Run().ConfigureAwait(false); } }).ConfigureAwait(false); }