예제 #1
0
 /// <summary>
 /// If it is unknown if a Dispatcher is attached, it will determine where to execute the action
 /// </summary>
 public async Task DetermineExecutionAsync(Action action)
 {
     if (Dispatcher != null)
     {
         await VisualTools.OnUIThreadAsync(action);
     }
     else
     {
         action();
     }
 }
예제 #2
0
 public static async Task ContinueOnUIThreadAsync(this Task Task, CoreDispatcher Dispatcher, Action action)
 {
     await Task.ContinueWith(async task => await VisualTools.OnUIThreadAsync(Dispatcher, action));
 }