Absolute UIElement coordinates in WinRT

Unable to find a way to determine the absolute position of a UIElement in a Metro style application. Does anyone know a solution?

(context: I want the popup to appear next to the button called by it)

+8
user-interface c # windows-runtime uielement
source share
1 answer

This should work ...

 private void Button_Click(object sender, RoutedEventArgs e) { var button = sender as Button; var ttv = button.TransformToVisual(Window.Current.Content); Point screenCoords = ttv.TransformPoint(new Point(0, 0)); } 
+21
source share

All Articles