将以下文本放在XAML中的一个flowdocument段落的内联中,使“charge”一词变为粗体。但是,使用xmlreader.ReadInnerXml从xml文件中读取相同的文本不会做任何事情。
离子和电子对这种电荷流的电阻会引起等离子体的欧姆加热。
如何使这个词变粗?
'Part of the code reading the xml file and displaying the content in a flowdocument
x.ReadToFollowing("Paragraph")
Dim b As String = x.ReadInnerXml
paragraph.Inlines.Add(b)
flowdocument.Blocks.Add(paragraph)
flowdocumentscrollviewer.Document=flowdocument
xml文件的一部分:
<HelpDocuments>
<ICPCanvas1Help Num="1">
<Paragraph Color="Black" FontWeight="Normal" Alignment="0" FontSize="14">
This interaction causes the ions and electrons
within the coil to flow in the closed annular paths
shown in the window. The resistance of the ions and
electrons to this flow of<Run FontWeight="Bold"> charge </Run> causes ohmic heating of
the plasma.
</Paragraph>
</ICPCanvas1Help>
</HelpDocuments>
答案 0 :(得分:0)
在要加粗的字词周围添加以下标记。
<Run FontWeight="bold">charge</Run>