File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ namespace Snoop . Data . Tree
2
+ {
3
+ using System . Windows ;
4
+ using System . Windows . Controls . Primitives ;
5
+
6
+ public class PopupTreeItem : DependencyObjectTreeItem
7
+ {
8
+ public PopupTreeItem ( Popup target , TreeItem parent , TreeService treeService )
9
+ : base ( target , parent , treeService )
10
+ {
11
+ this . PopupTarget = target ;
12
+ }
13
+
14
+ public Popup PopupTarget { get ; }
15
+
16
+ protected override void ReloadCore ( )
17
+ {
18
+ base . ReloadCore ( ) ;
19
+
20
+ if ( this . TreeService . TreeType == TreeType . Visual )
21
+ {
22
+ foreach ( var child in LogicalTreeHelper . GetChildren ( this . PopupTarget ) )
23
+ {
24
+ this . Children . Add ( this . TreeService . Construct ( child , this ) ) ;
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
Original file line number Diff line number Diff line change 5
5
using System . Windows ;
6
6
using System . Windows . Automation ;
7
7
using System . Windows . Automation . Peers ;
8
+ using System . Windows . Controls . Primitives ;
8
9
using System . Windows . Media ;
9
10
using System . Windows . Media . Media3D ;
10
11
@@ -50,6 +51,10 @@ public virtual TreeItem Construct(object target, TreeItem parent)
50
51
treeItem = new WindowTreeItem ( window , parent , this ) ;
51
52
break ;
52
53
54
+ case Popup poup :
55
+ treeItem = new PopupTreeItem ( poup , parent , this ) ;
56
+ break ;
57
+
53
58
case DependencyObject dependencyObject :
54
59
treeItem = new DependencyObjectTreeItem ( dependencyObject , parent , this ) ;
55
60
break ;
You can’t perform that action at this time.
0 commit comments