title: How to Async Files.ReadAllLines and await for results?
body: <p>I have the following code,</p>
  
  <pre><code>    private void button1_Click(object sender, RoutedEventArgs e)
      {
          button1.IsEnabled = false;
  
          var s = File.ReadAllLines("Words.txt").ToList(); // my WPF app hangs here
          // do something with s
  
          button1.IsEnabled = true;
      }
  </code></pre>
  
  <p><code>Words.txt</code> has a ton of words which i read into the s variable, I am trying to make use of <code>async</code> and <code>await</code> keywords in C# 5 using <code>Async CTP Library</code> so the WPF app doesn't hang. So far I have the following code,</p>
  
  <pre><code>    private async void button1_Click(object sender, RoutedEventArgs e)
      {
          button1.IsEnabled = false;
  
          Task&lt;string[]&gt; ws = Task.Factory.FromAsync&lt;string[]&gt;(
              // What do i have here? there are so many overloads
              ); // is this the right way to do?
  
          var s = await File.ReadAllLines("Words.txt").ToList();  // what more do i do here apart from having the await keyword?
          // do something with s
  
          button1.IsEnabled = true;
      }
  </code></pre>
  
  <p>The goal is to read the file in async rather than sync, to avoid freezing of WPF app.</p>
  
  <p>Any help is appreciated, Thanks!</p>