且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在WPF中获取绑定到控件的属性的名称

更新时间:2022-03-14 03:23:36

BindingExpression be = BindingOperations.GetBindingExpression((FrameworkElement)yourComboBox, ((DependencyProperty)Button.SelectedItemProperty));
string Name = be.ParentBinding.Path.Path;