Q:

How to programmatically assign the textbox size to auto?

I am newbie to windows phone development. I need to assign the textblock size to auto pro grammatically. How to do this ?

A:

If you take a look at the documentation on MSDN for FrameworkElement.Width

In addition to acceptable Double values, this property can also be Double.NaN. This is how you specify auto sizing behavior. In XAML you set the value to the string "Auto" (case insensitive) to enable the auto sizing behavior. 

