public static TimeSpan ShowLoadingScreen(AbortableBackgroundWorker bg, string message) { var p = new ProgressWindow(bg, message); p.ShowDialog(); return(p._timer.Elapsed); }
private ProgressWindow(AbortableBackgroundWorker worker, string message) { InitializeComponent(); this.Left = SystemParameters.PrimaryScreenWidth - this.Width - 10; MessageLabel.Content = message; _backgroundWorker = worker; _backgroundWorker.RunWorkerCompleted += _backgroundWorker_RunWorkerCompleted; _timer = Stopwatch.StartNew(); _backgroundWorker.RunWorkerAsync(); }
private ProgressWindow(AbortableBackgroundWorker worker, string message) : this(message) { _backgroundWorker = worker; _backgroundWorker.RunWorkerCompleted += _backgroundWorker_RunWorkerCompleted; _timer = Stopwatch.StartNew(); _backgroundWorker.RunWorkerAsync(); }