2013-06-24 61 views
0

我有一個XML如何將連續的XML轉換爲縮進的XML?

<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"><Paragraph TextAlignment="Left" FontFamily="Arial" NumberSubstitution.CultureSource="User"><Run FontSize="15">Foo Bar</Run></Paragraph></FlowDocument> 

我想將其轉換爲

<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> 
    <Paragraph TextAlignment="Left" FontFamily="Arial" NumberSubstitution.CultureSource="User"> 
     <Run FontSize="15">Foo Bar</Run> 
    </Paragraph> 
</FlowDocument> 

我不知道如何做到這一點?這個XML是由XamlWriter.Save動態生成,這是什麼函數返回成爲一個文本框的文字這樣

TxtBox1.Text = XamlWriter.Save(MyFlowDocument); 
+0

你是說,只是爲了查看或在代碼? –

+0

@IlyaKogan:請閱讀更新的問題。 –

回答