In my Silverlight 4 application, I have a ContentControl
with its ContentTemplate
property bound to a property in the data context. That works fine. However, the content of the template once rendered has its DataContext
set to null
. I would like the content to inherit the same DataContext
as set for the ContentControl
. Is there a way to get this to happen?
The ContentControl's template has the ContentControl's Content property as a DataContext. So try
<ContentControl Content="{Binding}" />
if this is merely the current DataContext.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With