/// <summary> /// Run a callback synchronously with a blocking progress dialog. /// </summary> /// <param name="Owner"></param> /// <param name="Task"></param> /// <param name="Callback"></param> public static void Run(Window Owner, string Task, Action Callback) { ProgressDialog process = new ProgressDialog(Task, false, (x, y) => Callback(), false, false) { Owner = Owner }; process.ShowDialog(); }
/// <summary> /// Run a callback asynchronously with progress and cancel support. /// </summary> /// <param name="Owner"></param> /// <param name="Task"></param> /// <param name="Callback"></param> public static void RunAsync(Window Owner, string Task, Action<Func<bool>, Action<double>> Callback) { ProgressDialog process = new ProgressDialog(Task, true, Callback, true, true) { Owner = Owner }; process.ShowDialog(); }
/// <summary> /// Run a callback asynchronously with progress support. /// </summary> /// <param name="Owner"></param> /// <param name="Task"></param> /// <param name="Callback"></param> public static void RunAsync(Window Owner, string Task, Action<Action<double>> Callback) { ProgressDialog process = new ProgressDialog(Task, true, (x, y) => Callback(y), false, true) { Owner = Owner }; process.ShowDialog(); }