Я пытаюсь внести изменения в пользовательский интерфейс, а затем запустить функцию
вот мой код:
private void btnAddChange_Document(object sender, RoutedEventArgs e)
{
System.Threading.ThreadStart start = delegate()
{
// ...
// This will throw an exception
// (it's on the wrong thread)
Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(changest));
//this.BusyIndicator_CompSelect.IsBusy = true;
//this.MainWindow_parent.BusyIndicator_MainWindow.IsBusy = true;
};
// Create the thread and kick it started!
new System.Threading.Thread(start).Start();
}
public void changest()
{
this.BusyIndicator_CompSelect.IsBusy = true;
this.MainWindow_parent.BusyIndicator_MainWindow.IsBusy = true;
t = "Creating document 1/2..";
}
функция, которую я хочу запустить после обновления пользовательского интерфейса / после окончания «запуска» ThreadStart:
string x = "";
for(int i =0;i<=1000;i++)
{
x+= i.ToString();
}
MessageBox.Show(x);
Так что я должен делать?
Заранее спасибо,
Дин.