Silverlight的:如何以编程方式设置附加属性 [英] silverlight: How to set attached properties Programmatically
本文介绍了Silverlight的:如何以编程方式设置附加属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我有一些行定义一个网格,在网格中的子控件。我怎么会去设置子控件的Grid.Row财产编程?
Suppose I have a grid with some row definitions, and a child control in that grid. How would I go about setting the Grid.Row property of the child control programatically?
推荐答案
要设置的值:
textBlock.SetValue(Grid.RowProperty, 3);
要重置值:
textBlock.SetValue(Grid.RowProperty, null);
这篇关于Silverlight的:如何以编程方式设置附加属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文