Assume something simple like:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="300" />
</Grid.ColumnDefinitions>
<TextBlock Name="MainTextBlock" Grid.Column="1" Text="Hello" />
</Grid>
How can I get the absolute position of MainTextBlock
?
I think this will work...
var ttv = MainTextBlock.TransformToVisual(Window.Current.Content);
Point screenCoords = ttv.TransformPoint(new Point(0, 0));