When clearing a root datacontext by removing from visual tree, binding further down the tree remains
[Silverlight] I have a large visual object tree I'm removing from the visual tree (Grid.Children.Clear()), upon removal the DataContext of the root nulls out, but further down the tree a binding开发者_JS百科 which looks like this
<Grid DataContext="{Binding FooBar}">
is staying bound to the object it was previously bound to. One would think that the binding would clear once it's DataContext has been nulled out. Is it wrong to clear the children of a grid like this? What else could be causing it?
精彩评论