private void OnWorkerMethodStart(NewForm nf, XDocument doc) { DispatcherClass myD = new DispatcherClass(); //myD.destinationFile = destinationFile; myD.doc = doc; myD.isChecked = (bool)nf.cbCopySequence.IsChecked; myD.videoLocation = new string[3] { nf.videoLocation, nf.tbxDestination.Text, nf.tbxVideo.Text }; myD.OnWorkerComplete += new DispatcherClass.OnWorkerMethodCompleteDelegate(OnWorkerMethodComplete); ThreadStart tStart = new ThreadStart(myD.WorkerMethod); Thread t = new Thread(tStart); t.Start(); pbw = new ProgressBarWindow(); pbw.HasCloseButton = false; pbw.Show(); }
void btnNewForm_Click(object sender, RoutedEventArgs e) { try { NewForm doc = new NewForm(); brdMain.Width = App.Current.MainWindow.Width - 100; brdMain.Height = App.Current.MainWindow.Height - 190; doc.scrollMain.Width = brdMain.Width - 60; doc.scrollMain.Height = brdMain.Height - 140; if (doc.stackContent.Children.Count > 0) { if (CenterContent.Children.Count > 0) CenterContent.Children.RemoveAt(0); CenterContent.Children.Add(doc); this.controlheader.btnAddElement.IsEnabled = false; this.controlheader.dockSearch.Visibility = System.Windows.Visibility.Collapsed; this.controlheader.btnSave.Content = "Submit"; this.controlheader.btnSave.Tag = "2"; this.controlheader.btnSave.IsEnabled = true; } } catch { MessageBox.Show("Invalid Template XML file", "Invalid Template", MessageBoxButton.OK); return; } }