Connect two elements on StackPanel

Hello,

I have an ItemControl which have its ItemsSource set to a List instance. The ItemsControl's ItemsPanel property is set to StackPanel.

I want to connect two elements in the ItemsControl with a line when the user click with the right mouse button on an item.

How can I draw a line between the two elements

Thank you,

Ido.



Answer this question

Connect two elements on StackPanel

  • X-Tatic

    You might be able to use the AdornerLayer to add visual elements "on top of" the items in the ItemsControl (such as lines and other shapes). This blog entry shows how to use adorners, but for drag-drop: http://blogs.msdn.com/marcelolr/archive/2006/03/03/543301.aspx If you were to put the ItemsControl in a Canvas, you should be able to use the Canvas's Top and Left attached properties to position the "adorner lines" between the items. Just an idea...

  • Connect two elements on StackPanel