예제 #1
0
        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;
        }
예제 #2
0
        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));
        }
예제 #3
0
 public static ProgressDialogResult Execute(Window owner, string label, Func <object> operationWithResult, ProgressDialogSettings settings)
 {
     return(ExecuteInternal(owner, label, (object)operationWithResult, settings));
 }
예제 #4
0
 public static ProgressDialogResult Execute(Window owner, string label, Func <BackgroundWorker, DoWorkEventArgs, object> operationWithResult, ProgressDialogSettings settings)
 {
     return(ExecuteInternal(owner, label, (object)operationWithResult, settings));
 }
예제 #5
0
 public static ProgressDialogResult Execute(Window owner, string label, Action <BackgroundWorker> operation, ProgressDialogSettings settings)
 {
     return(ExecuteInternal(owner, label, (object)operation, settings));
 }