如何从XAML文件读取值 [英] How to Read Values from a XAML file

查看:91
本文介绍了如何从XAML文件读取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在通过代码创建BuildDefinition并加载Build Process模板.

现在,我想读取并验证Build Process模板参数值.当我进行debuggig时,我可以看到它们是Xaml格式的.

例如:我在xaml文件中有一些"BuildType"值作为"Daily".我想读取这些值并对其进行验证

我不知道读取值的最佳方法是什么.任何人都可以让我知道如何做到这一点.

谢谢,
Srikrishna

Hi,

I am creating a BuildDefinition from code and Loading the Build Process template.

Now,I want to read and Validate the Build Process template parameter values.When I am debuggig,I could see that these are in Xaml format.

Ex: I have some value "BuildType" as "Daily" in xaml file.I want to read these values and validate them

I dont know what is the bestway to read the values.Can any one please let me know how can we do it.

Thanks,
Srikrishna

推荐答案

深入了解它,XAML只不过是XML.

XElement根= XElement.Parse(myXamlString);

此时,您可以检查每个子节点.
When you get right down to it, XAML is nothing more than XML.

XElement root = XElement.Parse(myXamlString);

At this point, you can inspect each child node.


这篇关于如何从XAML文件读取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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