title: Task.Run() how to pass object owned by other thread?
body: <p>How can i pass for example the text of a textBox UI element into a Task.Run() method? This code will throw an exception(... other thread owns it). When i pass the filter variabele, the exception is gone, is this because the string gets passed as value?</p>
  
  <pre><code>private async void filterTextBox_TextChanged(object sender, TextChangedEventArgs e)
  {
      if (currentSession.SessionFilenames != null)
      {
          string filter = filterTextBox.Text;
          dirListing.ItemsSource = await Task&lt;IEnumerable&lt;string&gt;&gt;.Run(()=&gt; Filterfiles(filterTextBox.Text));
      }
  }
  </code></pre>