I am creating a text block object in c#, so I don't have any XAML for it. How can I enable textwrapping on this object?
+3
A:
var textBlock = new TextBlock(/*params*/)
textBlock.TextWrap = TextWrapping.Wrap;
or
var textBlock = new TextBlock(/*params*/) { TextWrap = TextWrapping.Wrap};
Vash
2010-07-23 13:16:11
+1 but drop the `/*params*/` stuff `TextBlock` only has a default constructor
AnthonyWJones
2010-07-23 14:50:33