0
我有一個應該返回UIElementCollection
的函數。該函數需要具有children
屬性的UIElement
(即stackpanel
,grid
等),但不知道它是哪個UIElement
,所以我將它存儲到一個通用對象中。對象的子女
public UIElementCollection retCol (object givenObject){
...
}
我想返回givenObject
的孩子,但我不能找到一種方法,除了鑄造givenObject
作爲一個StackPanel或網格這樣做。
有沒有一種方法可以得到givenObject
的兒童財產?