public ProgressDialog(ProgressDialogSettings settings) { InitializeComponent(); if (settings == null) { settings = ProgressDialogSettings.WithLabelOnly; } if (settings.ShowSubLabel) { Height = 140; MinHeight = 140; SubTextLabel.Visibility = Visibility.Visible; } else { Height = 110; MinHeight = 110; 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); dialog.Owner = owner; if (!string.IsNullOrEmpty(label)) { dialog.Label = label; } return(dialog.Execute(operation)); }
public static ProgressDialogResult Execute(Window owner, string label, Func <object> operationWithResult, ProgressDialogSettings settings) { return(ExecuteInternal(owner, label, (object)operationWithResult, settings)); }