将XML加载到TreeView c#wpf

时间:2019-05-27 10:35:34

标签: c# xml wpf treeview

大家!如何从xml动态构建treeview?我只需要在树视图中构建名称,但是我不明白如何执行此操作。

例如,我有这样的xml:

<PluginMenuLayout DocSchema="1" Name="newlist">
<Plugin CLSID="{141AC902-4256-4332-4252-455645527E31}" CLSIDMD5="{7286134B-6592-8EE7-6BE8-60A5EC833C10}" Category="1" Name="BREVERB 2 Cakewalk" OriginalName="BREVERB 2 Cakewalk"/>
<Plugin CLSID="{5653544D-6C70-676D-656C-6F64796E6520}" Category="9" Name="Melodyne" OriginalName="Melodyne"/>
<Plugin CLSID="{56535454-482D-3374-6833-000000000000}" Category="9" Name="TH3" OriginalName="TH3"/>
<Folder Name="Okay">
<Plugin CLSID="{54DE473B-D405-4F77-A19A-995FDC7E374E}" Category="2" Name="Cakewalk TTS-1" OriginalName="Cakewalk TTS-1"/>
<Plugin CLSID="{F718845E-BC87-4248-83C4-A9C99294EA63}" Category="2" Name="GroovePlayer" OriginalName="GroovePlayer"/>
<Separator/>
<Plugin CLSID="{141AC902-4550-4E4F-5349-2D454C457E31}" CLSIDMD5="{9A2FD0E5-C1C5-2926-3FA0-8B45DBEDA75C}" Category="3" Name="SI-Electric Piano" OriginalName="SI-Electric Piano"/>
<Plugin CLSID="{141AC902-5354-5247-5349-2D5354527E31}" CLSIDMD5="{0D9CD314-8203-ACA3-F1BA-7896F2C3BCD7}" Category="3" Name="SI-String Section" OriginalName="SI-String Section"/>
</Folder>
</PluginMenuLayout>

0 个答案:

没有答案