public ProgressDialog(ProgressDialogSettings settings)
        {
            InitializeComponent();

            if (settings == null)
            {
                settings = ProgressDialogSettings.WithLabelOnly;
            }

            if (settings.ShowSubLabel)
            {
                Height    = 110;
                MinHeight = 110;
                SubTextLabel.Visibility = Visibility.Visible;
            }
            else
            {
                Height    = 70;
                MinHeight = 70;
                SubTextLabel.Visibility = Visibility.Collapsed;
            }

            CancelButton.Visibility = settings.ShowCancelButton ? Visibility.Visible : Visibility.Collapsed;

            ProgressBar.IsIndeterminate = settings.ShowProgressBarIndeterminate;
        }
        internal static ProgressDialogResult ExecuteInternal(Window owner, string label, object operation, ProgressDialogSettings settings)
        {
            ProgressDialog dialog = new ProgressDialog(settings)
            {
                Owner = owner
            };

            if (!string.IsNullOrEmpty(label))
            {
                dialog.Label = label;
            }

            return(dialog.Execute(operation));
        }
 internal static ProgressDialogResult Execute(Window owner, string label, Func <object> operationWithResult, ProgressDialogSettings settings)
 {
     return(ExecuteInternal(owner, label, (object)operationWithResult, settings));
 }