개정판 b74a9c91
macro기능 추가
Change-Id: I6e80960cf3ebf71f316f9d18cd890e90c827c40b
KCOM/Extensions/VisualHelper.cs | ||
---|---|---|
76 | 76 |
|
77 | 77 |
return result; |
78 | 78 |
} |
79 |
|
|
80 |
public static IEnumerable<DependencyObject> FindAllChildren(this DependencyObject dpo, Predicate<DependencyObject> predicate) |
|
81 |
{ |
|
82 |
//var results = new List<DependencyObject>(); |
|
83 |
//if (predicate == null) |
|
84 |
// yield return results; |
|
85 |
|
|
86 |
|
|
87 |
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(dpo); i++) |
|
88 |
{ |
|
89 |
var child = VisualTreeHelper.GetChild(dpo, i); |
|
90 |
if (predicate(child)) |
|
91 |
yield return child;// results.Add(child); |
|
92 |
|
|
93 |
var subChildren = child.FindAllChildren(predicate); |
|
94 |
foreach (var item in subChildren) |
|
95 |
{ |
|
96 |
yield return item; |
|
97 |
} |
|
98 |
|
|
99 |
//results.AddRange(subChildren); |
|
100 |
} |
|
101 |
} |
|
79 | 102 |
} |
80 | 103 |
|
81 | 104 |
public class MoveDirection |
내보내기 Unified diff