BindingContext.GetInnerProperty<T> 方法

定义

从绑定堆栈的适当层返回所请求的类型化对象(如果存在)。

public:
generic <typename T>
 where T : class T GetInnerProperty();
public T GetInnerProperty<T> () where T : class;
member this.GetInnerProperty : unit -> 'T (requires 'T : null)
Public Function GetInnerProperty(Of T As Class) () As T

类型参数

T

方法正在查询的类型化对象。

返回

T

如果存在,则为所请求的类型化对象 T,如果不存在,则为 null

示例

CustomBinding binding = new CustomBinding();
BindingParameterCollection bpCol = new BindingParameterCollection();
BindingContext context = new BindingContext(binding, bpCol);
XmlDictionaryReaderQuotas quotas = context.GetInnerProperty<XmlDictionaryReaderQuotas>();
Dim binding As New CustomBinding()
Dim bpCol As New BindingParameterCollection()
Dim context As New BindingContext(binding, bpCol)
Dim quotas As XmlDictionaryReaderQuotas = context.GetInnerProperty(Of XmlDictionaryReaderQuotas)()

注解

克隆绑定上下文,并对绑定上下文中存储的下一个绑定元素调用 GetProperty<T>(BindingContext)

适用于