如果我尝试将字体大小设置为丰富的编辑框,我会崩溃。
C#代码:
REB_Value.Document.SetText(TextSetOptions.None, "Company  Name,  \nStreet name with zip code. \n123-456-7890");  
XAML:
 <StackPanel Orientation="Vertical">
       <TextBlock Text="Lable for this Field:" Style="{StaticResource TextBlockStyle}"/>
       <RichEditBox Name="REB_Value"            
                    ContextMenuOpening="OnContextMenuOpening" 
                    Style="{StaticResource MyStyle}" 
                    SelectionChanged="OnSelectionChanged" >
      </RichEditBox> 
 </StackPanel>
风格:
<Style x:Key="MyStyle" TargetType="RichEditBox">
        ...
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="{StaticResource TextControlBorderThemeThickness}"/>
        <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
        <Setter Property="FontSize" Value="14"/>
       ...
    </Style>
如果我删除该属性<Setter Property="FontSize" Value="14"/>  或如果我在字符串末尾放置 /n ,则页面呈现/加载,即:"Company  Name,  \nStreet name with zip code. \n123-456-7890\n"
还有其他 RichEditBoxes 可以正常工作,例如:
SomeOtherREB.Document.SetText(TextSetOptions.None, "123456789"); 
我不明白为什么会这样?