摘要:
项目中遇到需要获取一个元素的所有子元素或后代元素, 系统有FindName("Name"),但我们需要的元素大部分都没有name,而且FindName只能返回一个结果。我们扩展了 方法,解决的获取所有子元素或后代元素 public static List<DependencyObject> GetChildern(this DependencyObject root) { if (root == null) return null; int count = VisualTreeHelper.GetChildrenCount(root); if (count &l 阅读全文
posted @ 2011-06-18 16:13
mjg
阅读(805)
评论(2)
推荐(0)

浙公网安备 33010602011771号