public static void Run(Func <TaskProgressDialog, Task> taskInvoker, Window owner = null)
        {
            var progressDialog = new TaskProgressDialog(taskInvoker, owner);

            progressDialog.ShowDialog();
            if (progressDialog.Exception != null)
            {
                throw progressDialog.Exception;
            }
        }
        public static T Run <T>(Func <TaskProgressDialog, Task <T> > taskInvoker, Window owner = null)
        {
            var progressDialog = new TaskProgressDialog(taskInvoker, owner);

            progressDialog.ShowDialog();
            if (progressDialog.Exception != null)
            {
                throw progressDialog.Exception;
            }
            return(((Task <T>)progressDialog.Task).Result);
        }