FrameworkElement.GetBindingExpression(DependencyProperty) 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回表示指定属性的绑定的 BindingExpression。
public:
System::Windows::Data::BindingExpression ^ GetBindingExpression(System::Windows::DependencyProperty ^ dp);
C#
public System.Windows.Data.BindingExpression GetBindingExpression(System.Windows.DependencyProperty dp);
member this.GetBindingExpression : System.Windows.DependencyProperty -> System.Windows.Data.BindingExpression
Public Function GetBindingExpression (dp As DependencyProperty) As BindingExpression
要从中获取绑定的目标 DependencyProperty。
如果目标属性具有活动的绑定,则返回 BindingExpression;否则返回 null
。
检查 的 null
返回值是一种可用于确定属性是否具有活动绑定的技术。
此方法实际上只是围绕 方法的 BindingOperations.GetBindingExpression 便捷包装器。
GetBindingExpression 将当前 实例和 dp
参数传递给 BindingOperations.GetBindingExpression。
产品 | 版本 |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |