2

I want to relocate some controls from one part in the visual tree to another.

  • can I do this?
  • and direction or hint on how to?
Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Inferis
  • 4,582
  • 5
  • 37
  • 47

2 Answers2

4

Simply remove the control from its parent, and then add it to the new parent.

Kent Boogaart
  • 175,602
  • 35
  • 392
  • 393
  • Yeah, that was my guess to, but I somehow seem to miss a good way how. I'm probably using the wrong types... – Inferis Jul 02 '09 at 15:10
  • You can remove and add items through a panel's Children collection, if it's a button or something else, then through Content. Also, if your element's aren't named for easy access then you can use the VisualTreeHelper to help you obtain the children/parent you want to move/move from: http://msdn.microsoft.com/en-us/library/system.windows.media.visualtreehelper.aspx – rmoore Jul 02 '09 at 16:47
-1

Yes, you can use Insert, this way you are able to choose exactly where its index is in the visual tree.

Ethan
  • 1