Is there a measuring equivalent in Silverlight xaml?

What I'm trying to accomplish: Create a dynamic bubble that expands in height and width depending on the amount of text in the bubble.

What I have investigated so far: In the SO article, they described the use of the measurestring function to determine the exact width or height so that dynamic changes in .cs can be made in width and height.

Is there something similar in Silverlight? The only thing I have is to use myTxt.Text.length and then change myGrid.height and myGrid.width to leave wasted space to accommodate all cases?

+3
source share
1 answer

On TextBlockyou will find the properties ActualWidthand ActualHeight. I think this is what you are looking for.

+3
source

Source: https://habr.com/ru/post/1739092/


All Articles