title: Cannot drag activities from WPF ListBox into WorkflowView
body: <p>I'm trying to host the Workflow Designer in a WPF application. The WorkflowView control is hosted under a WindowsFormsHost control. I've managed to load workflows onto the designer which is successfully linked to a PropertyGrid, also hosted in another WindowsFormsHost.</p>
  
  <pre><code>WorkflowView workflowView = rootDesigner.GetView(ViewTechnology.Default) as WorkflowView;
  window.WorkflowViewHost.Child = workflowView;
  </code></pre>
  
  <p>The majority of  the rehosting code is the same as in <a href="http://msdn.microsoft.com/en-us/library/aa480213.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa480213.aspx</a>.</p>
  
  <p>I've created a custom Toolbox using a ListBox WPF control bound to a list of ToolboxItems. </p>
  
  <pre><code>&lt;ListBox Grid.Row="1" Margin="0 0 0 4" BorderThickness="1" BorderBrush="DarkGray" ItemsSource="{Binding Path=ToolboxItems}" PreviewMouseLeftButtonDown="ListBox_PreviewMouseLeftButtonDown" AllowDrop="True"&gt;
   &lt;ListBox.Resources&gt;
    &lt;vw:BitmapSourceTypeConverter x:Key="BitmapSourceConverter" /&gt;
   &lt;/ListBox.Resources&gt;
   &lt;ListBox.ItemTemplate&gt;
    &lt;DataTemplate DataType="{x:Type dd:ToolboxItem}"&gt;
     &lt;StackPanel Orientation="Horizontal" Margin="3"&gt;
      &lt;Image Source="{Binding Path=Bitmap, Converter={StaticResource BitmapSourceConverter}}" Height="16" Width="16" Margin="0 0 3 0"     /&gt;
      &lt;TextBlock Text="{Binding Path=DisplayName}" FontSize="14" Height="16" VerticalAlignment="Center" /&gt;
      &lt;StackPanel.ToolTip&gt;
       &lt;TextBlock Text="{Binding Path=Description}" /&gt;
      &lt;/StackPanel.ToolTip&gt;
     &lt;/StackPanel&gt;
    &lt;/DataTemplate&gt;
   &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>In the ListBox_PreviewMouseLeftButtonDown handler:</p>
  
  <pre><code>private void ListBox_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  {
   ListBox parent = (ListBox)sender;
  
   UIElement dataContainer;
   //get the ToolboxItem for the selected item
   object data = GetObjectDataFromPoint(parent, e.GetPosition(parent), out dataContainer);
  
   //if the data is not null then start the drag drop operation
   if (data != null)
   {
    DataObject dataObject = new DataObject();
    dataObject.SetData(typeof(ToolboxItem), data);
  
    DragDrop.DoDragDrop(parent, dataObject, DragDropEffects.Move | DragDropEffects.Copy);
   }
  }
  </code></pre>
  
  <p>With that setup, I'm unable to drag any item from my custom Toolbox onto the designer. The cursor is always displayed as "No" anywhere on the designer.</p>
  
  <p>I've been trying to find anything about this on the net for half a day now and I really hope some can help me here. </p>
  
  <p>Any feedback is much appreciated. Thank you!</p>
  
  <p>Carlos</p>