What I am trying to accomplish: Create a dynamic bubble that expands on height and width depending on the amount of text in the bubble.
What I researched so far: In a SO article they described utilizing the measurestring function to figure out the exact width or height so dynamic changes in the .cs to the width and height can be accomplished.
Is there something like this in Silverlight? Is the only option I have is to utilize the myTxt.Text.length and then change the myGrid.height and myGrid.width to leave wasted spac开发者_C百科e to accommodate all cases?
On the TextBlock
you will find the properties ActualWidth
and ActualHeight
. I think that is what you are looking for.
精彩评论