tags:

views:

23

answers:

1

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
+1 but drop the `/*params*/` stuff `TextBlock` only has a default constructor
AnthonyWJones