title: Run a function when a Task finishes
body: <p>I have want to run a function asynchronously to prevent UI freezing. Here the the button click event.</p>
  
  <pre><code>private void btnEncrypt_Click(object sender, EventArgs e)
  {
      // Create new Vigenere object instant
      cryptor = new Vigenere(txtPassword.Text, txtBox.Text);
  
      // Run encryption async
      Task&lt;string&gt; T = new Task&lt;string&gt;(cryptor.Encrypt);
      T.Start();
  }
  </code></pre>
  
  <p>Now I want the following function to be called when the Task <code>T</code> finishes with it's return value as a parameter like this:</p>
  
  <pre><code>private void Callback(string return_value)
  {
      txtBox.Text = return_value
  
      // Some other stuff here
  }
  </code></pre>
  
  <p>How to achieve this?</p>