Can someone help me translate this to CLR code:
<ContentControl Content="{Binding}" />
Can someone help me translate this to CLR code:
<ContentControl Content="{Binding}" />
This works for me:
Dim dc = ccDetails.GetValue(ContentControl.DataContextProperty)
ccDetails.SetValue(ContentControl.ContentProperty, dc)
Would love to hear about better ideas.
I believe it would be something similar to this:
public void SetupManualBinding()
{
var cc = new ContentControl();
var binding = new Binding();
cc.SetBinding(ContentControl.ContentProperty, binding);
}
Use the SetBinding method:
ccDetails.SetBinding(ContentControl.ContentProperty, new Binding())