开发者

Checkbox Binding Information in WPF

I have a code snippet as below

<CheckBox Name="cb" Margin="1,2,1,0"  IsChecked="{Binding Path=IsManager}" IsEnabled="True"/>

Consider I don't know which propert开发者_StackOverflow社区y is bind to IsChecked property. I want to get programattically know the binding information of IsChecked property. How can do I that?


var binding = BindingOperations.GetBinding(cb, CheckBox.IsCheckedProperty);

Or you can get the actual expression generated for that particular instance of the binding:

var bindingExpression = BindingOperations.GetBindingExpression(cb, CheckBox.IsCheckedProperty);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜