개발 이야기/WPF
윈도우 내 컨트롤을 다른 윈도우로 위치를 변경할 떄 주의할 점
디베로
2016. 1. 13. 11:38
메인 윈도우 안에 어떤 컨트롤이 있다.
이 컨트롤을 다른 윈도우 창 내부에 위치시키도록 변경시키는 작업이 있었는데, 부모 자식 관계를 끊어줘야 한다고 한다.
이 방법이 맞는지는 모르겠지만,,,
1 2 3 4 5 6 7 8 | Control control; Window otherWindow; Grid parent = (Grid)this; parent.Children.Remove(control); Grid child = (Grid)otherWindow.Content; child.Children.Add(control); | cs |
난 저렇게 했다.