2009-08-12 60 views
0

我將Html轉換爲Xaml(準確地說是FlowDocument),並使用XamlReader解析新創建的FlowDocument。然後將我的新FlowDocument插入RichTextBox,但我的應用程序級別樣式都不適用於FLowDocument元素,例如Hyperlink s。 我的風格之一的例子:當使用XamlReader解析並插入FlowDocument到RichTextBox時,破碎樣式

<Style TargetType="{x:Type Hyperlink}"> 
    <Setter Property="Background" Value="DarkBlue" /> 
    <Setter Property="Cursor" Value="Hand" /> 
</Style> 

誰能幫助我這一個? 謝謝!

回答

0

我想通了......我用FlowDocumentScrollViewer代替RichTextBox來查看我的FLowDocument。出於某種原因,當容器是RichTextBox時,樣式不適用...