XAML/WinRT/Metro App Q n’ A: How to set border to TextBlock height and width?
Answered this question on Stackoverflow recently. To let a parent element of a textblock have the same size and width as the textblock a simple wrap with width and height set to auto wont do it. But why would you want to do such a thing anyway?
Well you might:
- Want to follow the recommendation to localize your app, which means that the text can differ in size based on the language- and setting a fixed size might cut the text of,- or allow to much space.
- Want to be able to dynamically change the text and keep (for example) the border snug
- or something else
One way to solve this:
[sourcecode language=“XML”]
//
//
[/sourcecode]
Comments
Scruff.R
Last modified on 2012-07-11