扩展WPF工具包的RichTextBox显示文本垂直

问题描述:

我想通过它的Text属性像这样丰富的内容(RTF格式)到丰富的文本框(扩展WPF工具包)结合

I'm trying to bind a rich content (RTF format) to a rich text box (of Extended WPF Toolkit) via its Text property like this

<extToolkit:RichTextBox x:Name="rtbKIContent" Margin="8,8,8,8" 
                                    IsEnabled="{Binding IsEditable}"
                                    Text="{Binding Content}">
                <extToolkit:RichTextBox.TextFormatter>
                    <extToolkit:RtfFormatter></extToolkit:RtfFormatter>

                </extToolkit:RichTextBox.TextFormatter>
                <extToolkit:RichTextBoxFormatBarManager.FormatBar>
                    <extToolkit:RichTextBoxFormatBar />
                </extToolkit:RichTextBoxFormatBarManager.FormatBar>
</extToolkit:RichTextBox>

有时,它工作得很好,但也有他们只是显示的文本垂直像这样的情况。

Sometimes it works just fine, but there are circumstances that they just display the text vertically like this.

我不知道什么地方错了......我应该怎么做,使之显示文本从左至右像正常?

I don't know what's wrong with it...What should I do to make it display text from left to right like normal?

如果您添加宽度RichTextBox的,它应该修复它。

If you add a width to the RichTextBox, it should fix it.

我这样做,所以它绑定到父。

I did this so it binds to the parent.

Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Grid, AncestorLevel=1}, Path=ActualWidth}"

请注意,你必须确定的 AncestorType 为您服务。但你可以做到这一点。 WIDTH =100

Note you will have to determine AncestorType for you. But you can do this too. Width="100"