TextBlock tbl= new TextBlock();
tbl.text="Kishore";
double x=tbl.ActualHeight;
double y=tbl.ActualWidth;
If i execute the code from the loaded event in Metro - winRT will return 0 for both.
How can I get the ActualWidth
in the Loaded
or SizeChanged
event?
Call Measure() then Arrange() and then ActualWidth
and ActualHeight
will be updated.
Can also do this via
UpdateLayout();
testBlock.ActualWidth
This could be useful when calculating multiple objects heights and widths.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With