从xaml文件中提取每个控件标记 [英] extract every control tag from a xaml file

查看:154
本文介绍了从xaml文件中提取每个控件标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要构建一个应用程序,我需要读取XAML文件中存在的所有控件标签及其属性,并将它们放入一些文本文件中,这样我才能使用它们。



我见过XamlReader,但它没有给出一个完整的标签(带有它的属性)。

xaml有一个新的解析器选项但它需要xaml schema我觉得很难搞定。



有什么方法可以做这件事吗?



在此先感谢。

解决方案

请参阅..

http://stackoverflow.com/questions/3942988/how-to-extract-所有出现的特定标签的xaml-xml文件/ 3943024#3943024 [ ^ ]


您是否尝试过使用LINQ?



LINQ To XML教程及示例 [ ^ ]

LINQ to XML [ ^

I need to build an application where i need to read all the control tags and their attributes present in XAML file and place them into some text file, so i can make use of them.

I have seen "XamlReader" but it does not give a complete tag(with its attributes).
There is an option for new parser for xaml but it needs xaml schema which i think is hard to get.

Is there any way I can do this thing??

Thanks in advance.

解决方案

See..
http://stackoverflow.com/questions/3942988/how-to-extract-all-occurences-of-a-specific-tags-of-an-xaml-xml-file/3943024#3943024[^]


Have you tried using LINQ?

LINQ To XML Tutorials with Examples[^]
LINQ to XML[^]


这篇关于从xaml文件中提取每个控件标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆