本文介绍了获取指定Silverlight控件的Xaml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了RichTextBox之外,我还没有找到一种方法来在Silverlight4中检索Control的XAML.有办法吗?

我想出(但尚未经过测试)的解决方法是创建一个XamlElement类,该类允许您指定属性,内容和子元素.一旦用代码构建了控件(并且构建了我的XamlElement集合),我就可以调用GetXaml()方法,该方法返回该元素的所有xaml(包括子属性和/或内容). />
有任何想法吗?

Other than the RichTextBox, I haven''t found a way to retrieve the XAML for a Control in Silverlight4. Is there a way?

A work-around I''ve come up with (but haven''t yet tested) is to create a XamlElement class that allows you to specify attributes, content, and child elements. Once the control has been constructed in code (and my XamlElement collection has been built), I can call a GetXaml() method that returns all of the xaml for the element (including children attributes, and/or content).

Any ideas? Suggestions?

推荐答案


这篇关于获取指定Silverlight控件的Xaml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 14:07