WPF FrameworkElement Parent and Moving a UIElement
- by Adam Driscoll
I'm trying to move a control from one parent to another (if this will work I'm not quite sure). I can get a hold of the control that I want to move. Here is my code:
public void MoveElement(UIElement uiElement)
{
var element = ((FrameworkElement)uiElement).Parent;
//TODO:Remove from parent
myControl.Children.Add(uiElement);
}
When I…