开发者

how to set datacontext of child control in silverlight

I have created user control myControl in myControl I have taken another custom control tutorialControl. I have set DataContxt of tutorialControl to id and I want to access this data context in loaded event of tutorial. but I am getting data开发者_如何学JAVA context as null. Can some body help?


I don't know if I understand your question correct but you can send the binding in xaml as a elementbinding

"{Binding Value, Mode=OneWay, ElementName=myControl}"

With this you can reference the context of another element.

see an example of Elementbinding here.

hope this is what you were trying to do...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜