9600的限制是为了不占用所有的CPU时间。
由 Microsoft 在 2012/4/11 於 16:03 公布Text is displayed by one of two internal classes: SimpleTextLine and FullTextLine. The former is faster but less general - it's used for most text unless special formatting features are required.
The 9600-character limit exists to defend against very long lines taking all the CPU time. In 4.0 it applied only to FullTextLine in 4.5 it applies to both classes. You can see the same effect in 4.0 by doing anything that causes the text to use FullTextLine - for example, set FlowDirection="RightToLeft".
We need to keep the limit in effect for SimpleTextLine - the reasons we did that trump any compatibility concerns. Your behavior is a consequence. (You could argue that TextBlock/Box should only draw the first line when TextWrapping=NoWrap and the line is split because of the limit, but that would be a more significant behavior change that we won't address in 4.5.)
- WPF team
参见:https://connect.microsoft.com/VisualStudio/feedback/details/735541/wpf-textbox-and-textblock-will-show-text-wrap-when-text-is-more-than-9600
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)