It seems to be possible in this project...
After they use pd = new ProgressDialog();
, the new window appears.
How did they do that?
It seems to be possible in this project...
After they use pd = new ProgressDialog();
, the new window appears.
How did they do that?
BackgroundWorker worker;
ProgressDialog pd;
Calling form is done through a ShowDialog().
private void btnReportProgress_Click(object sender, RoutedEventArgs e)
{
int maxRecords = 1000;
pd = new ProgressDialog();
// code...
pd.ShowDialog();
}
In ProgressDialog.xaml.cs identified two properties
public string ProgressText
public int ProgressValue
In the class Window1.xaml.cs values of these properties change.
pd.ShowDialog() is the last line of the btnReportProgress_Click function. It shows modal dialog, which is closed when the worker thread is completed, see worker.RunWorkerCompleted event subscription.
Maybe they call this.Show()
in the constructor of ProgressDialog
class.