I'm not sure if there is a solution to this. But it is niggling at me and irritating me.
I'm using WPF and Visual Studio 2008. I've designed a beautiful UI :). I have a help text control which is contextual as to which control has been clicked. When the app first loads it has default text set. "Welcome to the X screen here you can ..........". This is inside a user control, which sits inside a tab control, inside a window. The user control has minheight and minwidth set (I suspect this is why the designer does what it does).
I set the initial text in the XAML, with textwrapping set to true. The problem is that the designer decides to put th开发者_Go百科is all on one line - which really throws out the view (I can't see the entire UI in one screen at 100%, if I scale it down I can't read things, etc)
Is there anyway to get around this (other than setting the text in the code instead - (is there any difference between doing this and doing it in the xaml?!)) Maybe that is the only solution.
Thanks for reading.
Try this:
<TabControl>
<TabItem MaxWidth="200">
<TabItem.Header>
<TextBlock TextWrapping="Wrap">
hi asdfkjl; asdf asdf asdf sdaf sadf safd sf sadf fasf asd f asdf as df sadf asd f asdf sd f sadf as df asdf asd f asdf as df
</TextBlock>
</TabItem.Header>
</TabItem>
</TabControl>
I tested it in kaxaml and it wraps like you'd expect it to.
Have you considered using a FlowDocumentReader
control for this? I haven't experienced the problem you described but this control was very useful for me to render help text.
精彩评论