private void SearchButton_Click(object sender, RoutedEventArgs e) { string lName = SearchBox.Text; //Sleep GUI to wait for results SearchBox.IsReadOnly = true; IndexBox.IsReadOnly = true; GoButton.IsEnabled = false; SearchButton.IsEnabled = false; //Set delegate target function SearchRequest sOp = AsyncSearchFunction; //Set callback function to run when async task finishes running AsyncCallback callback = this.OnSearchComplete; //Begin async task, searching sOp.BeginInvoke(lName, callback, null); }