title: Silverlight DragDrop.DoDragDrop()
body: <p>I am really struggling to get a simple drag and drop sample working in Silverlight 4.</p>
  
  <p>Here's what I have:</p>
  
  <p><strong>XAML</strong></p>
  
  <pre><code>&lt;UserControl x:Class="TestDragDrop.MainPage" Width="350" Height="200"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
      &lt;Grid Background="White"&gt;
          &lt;Rectangle Margin="50,50,200,50" Fill="Orange" MouseLeftButtonDown="r1_MouseLeftButtonDown" /&gt;
          &lt;Rectangle Margin="200,50,50,50" Fill="Orange" AllowDrop="true" Drop="r2_Drop" /&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p><strong>Code-Behind</strong></p>
  
  <pre><code>public partial class MainPage : UserControl
  {
      public MainPage()
      {
          InitializeComponent();
      }
  
      private void r1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
      {
          DragDrop.DoDragDrop((Rectangle)sender, "test data", DragDropEffects.All, DragDropKeyStates.LeftMouseButton);
      }
  
      private void r2_Drop(object sender, System.Windows.DragEventArgs e)
      {
          MessageBox.Show("Drop: " + e.Data.ToString());
      }
  }
  </code></pre>
  
  <p>The <code>DragDrop.DragDropCompleted</code> event does fire, however the sender parameter is always null and the event args do not really help me finding more about the event.</p>
  
  <p>I have also tried to use a custom control implementing IAcceptDrop with no luck.</p>
  
  <p>Also, when I start the drag operation, I have no visual feedback that something is happening (no change in the cursor or anything). Is there something wrong?</p>
  
  <p>All the samples I have found use the DragDropTargets. Is my only resort to implement a DragDropTarget for the particular type of controls I want to use?</p>