Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get height and width of dynamically designed user control while added in wpf canvas control?

Hello I am developing one wpf application. I am adding object of myUserControl in canvas. i need height and with of added usercontrol. Now problem is that user control is design dynamically, i am creating grid and adding row and column according to configured by user, and i am giving auto in height and width. so i am not getting actual height and width of user control while adding it in canvas.

like image 909
Vishal Parekh Avatar asked Jan 27 '12 13:01

Vishal Parekh


1 Answers

All UI elements derived from FrameworkElement have the ActualWidth and ActualHeight properties.

like image 194
Clemens Avatar answered Nov 14 '22 21:11

Clemens