什么是{Binding}的代码隐藏等价物?

Max*_*der 2 c# silverlight silverlight-3.0

这段代码的代码隐藏等价物是什么?

<SomeControl SomeProperty="{Binding}"/>
Run Code Online (Sandbox Code Playgroud)

(如果我想在SomeControl的代码隐藏中而不是在消费者的XAML中执行此操作.)

也就是说,我如何构造一个Binding对象,以便直接绑定到当前对象的DataContext,而不是某些属性?

Hei*_*nzi 5

既然{Binding}只是一个捷径{Binding Path=.},它应该就是这么简单

SomeControl.SetBinding(SomeControl.SomeProperty, new Binding("."));
Run Code Online (Sandbox Code Playgroud)