1
如果我尝试设置字体大小,Rich编辑框会崩溃。RichEditBox在某些情况下崩溃。
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在我的字符串末尾 ie:"Company Name, \nStreet name with zip code. \n123-456-7890\n"
还有其他RichEditBoxes工作正常, 如:
SomeOtherREB.Document.SetText(TextSetOptions.None, "123456789");
我不明白为什么会这样?
由于某种原因,我现在无法再现它。它现在没有“\ n”。 :?奇怪的。 – user732029