I have a dialog with some txb\'s and a button. When this button is clicked I want to change the button\'s Text, disable the button, start some Logic and then close the Window.>
You could use a backgroundworker:
BackgroundWorker worker = new BackgroundWorker();
worker.WorkerSupportsCancellation = false;
worker.WorkerReportsProgress = false;
worker.DoWork += (s, e) =>
{
//perform action
};
worker.RunWorkerCompleted += (s, e) =>
{
//close window
};
worker.RunWorkerAsync();
See this for more details.