title: How do I drag files from my application to the Desktop?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3040415/c-wpf-net-drag-and-drop-to-desktop-explorer">C# / WPF / .NET - Drag and drop to Desktop / Explorer</a>  </p>
  </blockquote>
  
  
  
  <p>I've managed to drag files from the Desktop into my WPF application.  Now I want to drag them back out.</p>
  
  <p>This code does not work.  Everything looks right (the cursor turns into a +) but the file is not copied.</p>
  
  <pre><code>listBoxItem.PreviewMouseLeftButtonDown += (o, e) =&gt;
  {
      Console.WriteLine("drag leave");
  
      // changing this line to: var data = "a string"; works for text dragging
      var data = new DataObject(DataFormats.FileDrop, filePath);
  
      // also tried DragDropEffects.Copy with no success
      DragDrop.DoDragDrop(item, data, DragDropEffects.All);
  };
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Very similar question here but I don't understand their answer: <a href="https://stackoverflow.com/questions/6073953/c-drag-drop-dataobject">c# drag drop DataObject</a></p>
  
  <p>Thanks,</p>
  
  <p>Neal</p>