Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Grid Question, can I determinate the absolute position of something, which is positioned automatically in a WPF Grid?

Tags:

wpf

I like to use a grid to position some objects in WPF, because it cares about the position and stuff. In addition, however I also like to be able to draw accross the cells with a Canvas.

I figured out that this can be done by embedding the grid in a canvas. However in order to connect two elements, I need then the absolute position in pixels.. any ideas?

like image 636
Nils Avatar asked Dec 06 '25 17:12

Nils


1 Answers

From code you can use the UIElement.TranslatePoint() method.

like image 65
Kent Boogaart Avatar answered Dec 08 '25 09:12

Kent Boogaart



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!