File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
ICSharpCode.ILSpyX/TreeView Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,10 @@ public bool IsSelected {
181181
182182 #endregion
183183
184- #region OnChildrenChanged
184+ #region OnParentChanged / OnChildrenChanged
185+ public virtual void OnParentChanged ( )
186+ { }
187+
185188 public virtual void OnChildrenChanged ( NotifyCollectionChangedEventArgs e )
186189 {
187190 if ( e . OldItems != null )
@@ -190,6 +193,7 @@ public virtual void OnChildrenChanged(NotifyCollectionChangedEventArgs e)
190193 {
191194 Debug . Assert ( node . modelParent == this ) ;
192195 node . modelParent = null ;
196+ node . OnParentChanged ( ) ;
193197 Debug . WriteLine ( "Removing {0} from {1}" , node , this ) ;
194198 SharpTreeNode removeEnd = node ;
195199 while ( removeEnd . modelChildren != null && removeEnd . modelChildren . Count > 0 )
@@ -227,6 +231,7 @@ public virtual void OnChildrenChanged(NotifyCollectionChangedEventArgs e)
227231 {
228232 Debug . Assert ( node . modelParent == null ) ;
229233 node . modelParent = this ;
234+ node . OnParentChanged ( ) ;
230235 node . UpdateIsVisible ( isVisible && isExpanded , false ) ;
231236 //Debug.WriteLine("Inserting {0} after {1}", node, insertionPos);
232237
You can’t perform that action at this time.
0 commit comments