public ProgressDialog(ProgressDialogSettings settings) { InitializeComponent(); //double top; //double right; //if(settings == null) // settings = ProgressDialogSettings.WithLabelOnly; //if(settings.ShowSubLabel) //{ // top = 38; // Height = 110; // SubTextLabel.Visibility = Visibility.Visible; //} //else //{ // top = 22; // Height = 100; // SubTextLabel.Visibility = Visibility.Collapsed; //} //if(settings.ShowCancelButton) //{ // right = 74; // CancelButton.Visibility = Visibility.Visible; //} //else //{ // right = 0; // CancelButton.Visibility = Visibility.Collapsed; //} //ProgressBar.Margin = new Thickness(0, top, right, 0); ProgressBar.IsIndeterminate = settings.ShowProgressBarIndeterminate; }
public static ProgressDialogResult ExecuteInternal(Window owner, string label, object operation, ProgressDialogSettings settings) { var dialog = new ProgressDialog(settings) { 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)); }
public static ProgressDialogResult Execute(Window owner, string label, Func <BackgroundWorker, DoWorkEventArgs, object> operationWithResult, ProgressDialogSettings settings) { return(ExecuteInternal(owner, label, (object)operationWithResult, settings)); }
public static ProgressDialogResult Execute(Window owner, string label, Action <BackgroundWorker> operation, ProgressDialogSettings settings) { return(ExecuteInternal(owner, label, (object)operation, settings)); }