IDataItemContainer.DataItem 属性

定义

实现时,获取在简化的数据绑定操作中所使用的 objectWhen 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

object,表示执行数据绑定操作时要使用的值。An object that represents the value to use when data-binding operations are performed.

示例

下面的代码示例演示如何实现使用接口的类型 IDataItemContainerThe following code example demonstrates how to implement a type that uses the IDataItemContainer interface. SimpleSpreadsheetRow类是一个容器类,其中包含名为的成员 DataThe SimpleSpreadsheetRow class is a container class with a member named Data. 它通过将 IDataItemContainer Data 属性映射到属性来实现接口 DataItemIt implements the IDataItemContainer interface by mapping the Data property to the DataItem property. 简化的数据绑定表达式可以使用属性绑定到数据对象 DataItemSimplified 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.

适用于

另请参阅