我有一個從數據庫呈現html內容的頁面。現在我想在Silverlight中顯示它。我想要用silverlight替換掉所有的標籤。或者有人已經建立了類似的東西?這似乎是最好的解決方案。任何人誰有任何意見?將html內容轉換爲等效的silverlight內容?
這將是一種工作,如果有辦法讓超鏈接在silverlight richtextbox控件中工作。
<RichTextBox HorizontalAlignment="Left" Margin="25,23,0,0" Name="richTextBox1" VerticalAlignment="Top" Height="251" Width="352" >
<Paragraph FontSize="14" FontWeight="Bold" >Hello</Paragraph>
</RichTextBox>
一樣,這是不允許在Silverlight:
<TextBlock>
Hello <HyperlinkButton > World </HyperlinkButton>
</TextBlock>
我將不得不這樣做:
<StackPanel Orientation="Horizontal">
<TextBlock >
Hello
</TextBlock>
<HyperlinkButton>
World
</HyperlinkButton>
</StackPanel>
這將是HTML這樣的:
<h3> Hello <a href="#" >World</a></h3>
在某種程度上, ght的方式會工作,但將html-content轉換爲xaml似乎很乏味。如果有人有興趣寫這樣的圖書館會很好。
Flash允許有一些HTML的內容,我想請參閱Silverlight中的該功能。特別是在富文本編輯器中沒有鏈接會限制網絡的工作方式。 – marko