IDataItemContainer.DataItem 属性
定义
实现时,获取在简化的数据绑定操作中所使用的 object。When implemented, gets an object that is used in simplified data-binding operations.
public:
property System::Object ^ DataItem { System::Object ^ get(); };
public object DataItem { get; }
member this.DataItem : obj
Public ReadOnly Property DataItem As Object
属性值
object,表示执行数据绑定操作时要使用的值。An object that represents the value to use when data-binding operations are performed.
示例
下面的代码示例演示如何实现使用接口的类型 IDataItemContainer 。The following code example demonstrates how to implement a type that uses the IDataItemContainer interface. SimpleSpreadsheetRow类是一个容器类,其中包含名为的成员 Data 。The SimpleSpreadsheetRow class is a container class with a member named Data. 它通过将 IDataItemContainer Data 属性映射到属性来实现接口 DataItem 。It implements the IDataItemContainer interface by mapping the Data property to the DataItem property. 简化的数据绑定表达式可以使用属性绑定到数据对象 DataItem 。Simplified data-binding expressions can bind to the data object using the DataItem property.
object IDataItemContainer.DataItem
{
get
{
return Data;
}
}
ReadOnly Property DataItem() As Object Implements IDataItemContainer.DataItem
Get
Return Data
End Get
End Property
注解
DataItem属性标识用于数据绑定操作和后期绑定表达式的对象。The DataItem property identifies an object that is used in data-binding operations and late-binding expressions.