public IWaitDialog CreateWaitDialog(DialogMode dialogMode, bool isIndeterminate = false)
        {
            IWaitDialog dialog = null;

            this.InvokeInUIThread(() =>
            {
                dialog = WaitProgressDialog.CreateWaitDialog(this.dialogHost, dialogMode, this.dispatcher, isIndeterminate);
                dialog.CloseWhenWorkerFinished = true;
            });
            return(dialog);
        }
        public IProgressDialog CreateProgressDialog(string message, string readyMessage, DialogMode dialogMode, bool isIndeterminate = false)
        {
            IProgressDialog dialog = null;

            this.InvokeInUIThread(() =>
            {
                dialog = WaitProgressDialog.CreateProgressDialog(this.dialogHost, dialogMode, this.dispatcher, isIndeterminate);
                dialog.CloseWhenWorkerFinished = false;
                dialog.ReadyMessage            = readyMessage;
                dialog.Message = message;
            });
            return(dialog);
        }
        public static IProgressDialog CreateProgressDialog(
            IDialogHost dialogHost,
            DialogMode dialogMode,
            Dispatcher dispatcher,
            bool isIndeterminate)
        {
            IProgressDialog dialog = null;

            dispatcher.Invoke(
                new Action(() => dialog = new WaitProgressDialog(
                               dialogHost, dialogMode, isIndeterminate, dispatcher)),
                DispatcherPriority.DataBind);
            return(dialog);
        }