title: Non-Generic TaskCompletionSource or alternative
body: <p>I'm working with an alert window (Telerik WPF) that is normally displayed asynchronously ( code continues running while it is open) and I want to make it synchronous by using async/await.</p>
  
  <p>I have this working with <code>TaskCompletionSource</code> but that class is generic and returns an object like <code>Task&lt;bool&gt;</code> when all I want is a plain <code>Task</code> with no return value.</p>
  
  <pre><code>public Task&lt;bool&gt; ShowAlert(object message, string windowTitle)
  {
      var dialogParameters = new DialogParameters { Content = message };
  
      var tcs = new TaskCompletionSource&lt;bool&gt;();
      dialogParameters.Closed += (s, e) =&gt; tcs.TrySetResult(true);
  
      RadWindow.Alert(dialogParameters);
  
      return tcs.Task;
  }
  </code></pre>
  
  <p>The code that calls that method is</p>
  
  <pre><code>await MessageBoxService.ShowAlert("The alert text.")
  </code></pre>
  
  <p>How can I return a non-generic Task that functions similarly which I can await until the <code>dialogParameters.Closed</code> event fires?  I understand that I could just ignore the <code>bool</code> that is being returned in this code.  I am looking for a different solution than that.</p>