开发者

Is there anyway to stop automatic DataContext inheritance in Silverlight?

Is there anyway to stop automatic DataContext inh开发者_运维知识库eritance in Silverlight?

I Set my DataContext on my parent UserControl in code. As a result all the xaml bindings inside the UserControl try to bind to the new DataConext they get (through the automatic DataContext Inheritance).

The DataContext's for the children elements (actually they are children of children of children) of the UserControl is something I need to set in the UserControl's code... I don't want them being all smart because they end up binding to the wrong data object! :-)


Can you set the DataContext to {x:Null} in XAML, or null in code, for the items you don't want the inherited context for?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜