开发者

When clearing a root datacontext by removing from visual tree, binding further down the tree remains

开发者 https://www.devze.com 2023-03-15 04:15 出处:网络
[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开发者

[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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号