title: WPF Drag and Drop blocking operations
body: <p>I am working with a WPF application that is using Drag and Drop functionality.</p>
  
  <p>The Drag and Drop operation is a blocking operation and is having some negative side effects in my application. I have recently added the use of an adorner to show the item dragging. The problem with this is that in order to do this, I need to track the current position of the mouse. When a Drag and Drop operation is initiated, it blocks further execution until the item is dropped.</p>
  
  <p>I have read that a fix for this is to execute the drag and drop in its own thread, and then update the UI. I read this article here </p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/ms741870.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms741870.aspx</a></p>
  
  <p>I am not sure if this is what I am looking to do, but It sounds like what I need. </p>
  
  <p>Is there another fix around this?</p>
  
  <p>Here is the code that I need to execute.</p>
  
  <pre><code> private void FieldItemGrid_PreviewMouseMove(object sender, MouseEventArgs e)
      {
          if (_isDown)
          {
              if ((_isDragging == false))
              {
                 /*Add Adorner to Item that is being dragged*/
                  DragStarted(e.GetPosition(this));
              }
              if (_selectedElement != null)
              {
                  /*Begin Drag Operation*/
                  DragDrop.DoDragDrop(_selectedElement, _selectedElement, DragDropEffects.Move);
              }
  
              /*The following code is not executed until the dragged item is released*/
              if (_isDragging)
              {  
                  /*Update Current Position of Mouse to update adorner position*/
                  DragMoved(e.GetPosition(this));
              }
          }
  
      }
  </code></pre>