Search code examples
c#silverlightwindows-phone-7widthtextblock

Silverlight - Width of a Textblock


It's a simple question:

How do I get the Width of a TextBlock?

The width of this TextBlock is set to Auto, in the XAML.

How do I get the Width of this TextBlock via code?


Solution

  • Just use the property

    TextBlock.ActualWidth