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