Ejemplo n.º 1
0
        public void LaunchWorkItem <T>() where T : Workitem
        {
            if (_currentWorkItem is T)
            {
                return;
            }
            Workitem workitem = Container.Resolve <T>();

            _currentWorkItem?.Terminate();
            _currentWorkItem = workitem;
            workitem.Run();
        }
Ejemplo n.º 2
0
 /// <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);
 }