ウィンドウへのUIElementの相対位置
質問
WPFで、私は私のコードでTabControl
のコーナーの位置を取得したいので、示されたとき、私はそれに応じてToolWindowの場所を設定することができます。
どのように私は与えられた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
解決
Point pt = tabControl.TranslatePoint(new Point(0, 0), windowInstance);
所属していません StackOverflow