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
        public ProgressDialog(ProgressDialogSettings settings)
        {
            InitializeComponent();

            this.ShowInTaskbar = false;


            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 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;
        }
        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));
        }
 internal static ProgressDialogResult Execute(Window owner, string label, Func <object> operationWithResult, ProgressDialogSettings settings)
 {
     return(ExecuteInternal(owner, label, (object)operationWithResult, settings));
 }
示例#6
0
 internal static ProgressDialogResult Execute(Window owner, string label, Func <BackgroundWorker, DoWorkEventArgs, object> operationWithResult, ProgressDialogSettings settings)
 {
     return(ExecuteInternal(owner, label, (object)operationWithResult, settings));
 }
示例#7
0
 internal static ProgressDialogResult Execute(Window owner, string label, Action <BackgroundWorker> operation, ProgressDialogSettings settings)
 {
     return(ExecuteInternal(owner, label, (object)operation, settings));
 }
        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);
        }
 internal static ProgressDialogResult Execute(Window owner, string label, Func<BackgroundWorker, DoWorkEventArgs, object> operationWithResult, ProgressDialogSettings settings)
 {
     return ExecuteInternal(owner, label, (object)operationWithResult, settings);
 }
 internal static ProgressDialogResult Execute(Window owner, string label, Func<object> operationWithResult, ProgressDialogSettings settings)
 {
     return ExecuteInternal(owner, label, (object)operationWithResult, settings);
 }
 internal static ProgressDialogResult Execute(Window owner, string label, Action<BackgroundWorker> operation, ProgressDialogSettings settings)
 {
     return ExecuteInternal(owner, label, (object)operation, settings);
 }
 public static ProgressDialogResult Execute(Window owner, string label, Action operation, ProgressDialogSettings settings)
 {
     return(ExecuteInternal(owner, label, (object)operation, settings));
 }