Creating drag handles

67 views
Skip to first unread message

David Keaveny

unread,
Apr 19, 2012, 1:14:41 AM4/19/12
to gong-wpf...@googlegroups.com
Firstly - thanks for such a nice piece of code!

Secondly, how would you implement a drag handle? For instance, if I'm building something like Visual Studio's Entity Framework model designer, and I want to be able to drag a "entity" around a canvas, I might have a control something like this:

<UserControl>
   
<Border Thickness="2">
       
<DockPanel LastChildFill="True">
           
<TextBlock DockPanel.Dock="Top" Text="{Binding TableName}" />
           
<ListBox ItemsSource="{Binding Columns}" />
       
</DockPanel>
   
</Border>
</UserControl>
How would I make the entire control draggable only if the user was clicking on the TextBlock? If the user clicked on an item in the ListBox, I would want to initiate a completely different drag-drop operation.

Reply all
Reply to author
Forward
0 new messages