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,表示执行数据绑定操作时要使用的值。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. 类是一个容器类, 其中包含名为Data的成员。 SimpleSpreadsheetRowThe 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.

适用于

另请参阅