title: Fire callback after async Task method
body: <p>I need to fire a callback when the <code>foreach</code> loop has finished searching through each item int the <code>List&lt;&gt;</code>. </p>
  
  <pre><code>private async void startSearchBtn_Click(object sender, EventArgs e)
  {
      await Search(files, selectTxcDirectory.SelectedPath, status);
  }
  
  private static async Task Search(List&lt;string&gt; files, string path, Label statusText)
  {
      foreach (string file in files)
      {
          XmlDocument xmlDoc = new XmlDocument();
          xmlDoc.Load(file);
  
          statusText.Text = "Started scanning...";
          using (XmlReader reader = XmlReader.Create(new StringReader(xmlDoc.InnerXml), new XmlReaderSettings() { Async = true }))
          {
              while (await reader.ReadAsync())
              {
                  if ((reader.NodeType == XmlNodeType.Element) &amp;&amp; (reader.Name == "LineName"))
                  {
                      Console.WriteLine(reader.ReadInnerXml());
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>Is this possible and if so how can it be done?</p>