0
我有一个应该返回UIElementCollection
的函数。该函数需要具有children
属性的UIElement
(即stackpanel
,grid
等),但不知道它是哪个UIElement
,所以我将它存储到一个通用对象中。对象的子女
public UIElementCollection retCol (object givenObject){
...
}
我想返回givenObject
的孩子,但我不能找到一种方法,除了铸造givenObject
作为一个StackPanel或网格这样做。
有没有一种方法可以得到givenObject
的儿童财产?