2009-12-06 4 views
3

WPF에서 코드 위치에 TabControl의 모서리 위치를 가져오고 싶을 때 표시 될 때 ToolWindow의 위치를 ​​설정할 수 있습니다.Window에 상대적인 UIElement 위치

주어진 UIElement의 위치를 ​​얻으려면 어떻게해야합니까?

buildingInfoWindow = new BuildingInfoWindow(); // BuildingWindow : System.Windows.Window 
buildingInfoWindow.Owner = this; 

//buildingInfoWindow.Left = ?; // relative X coordinate of my TabControl 
//buildingInfoWindow.Top = ?; // relative Y coordinate of my TabControl 

답변

7
Point pt = tabControl.TranslatePoint(new Point(0, 0), windowInstance);