WPF 设计器查看刺激 - 没有文本换行
我不确定是否有解决方案。但这让我烦恼,让我恼火。
我正在使用 WPF 和 Visual Studio 2008。我设计了一个漂亮的 UI :)。我有一个帮助文本控件,它与单击的控件相关。当应用程序首次加载时,它会设置默认文本。 “欢迎来到 X 屏幕,在这里你可以......”。它位于用户控件内,该控件位于窗口内的选项卡控件内。用户控件设置了 minheight 和 minwidth (我怀疑这就是设计器这样做的原因)。
我在 XAML 中设置了初始文本,并将 textwrapping 设置为 true。问题是设计师决定将所有这些都放在一行上 - 这确实会破坏视图(我无法在一个屏幕上以 100% 的比例看到整个 UI,如果我将其缩小,我将无法阅读内容,等等)
有没有办法解决这个问题(除了在代码中设置文本之外 - (这样做和在 xaml 中这样做有什么区别吗?!)) 也许这是唯一的解决办法。
感谢您的阅读。
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 this 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
我在 kaxaml 中测试了它,它像您期望的那样包装。
Try this:
I tested it in kaxaml and it wraps like you'd expect it to.
您是否考虑过为此使用
FlowDocumentReader
控件?我没有遇到您所描述的问题,但此控件对于我呈现帮助文本非常有用。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.