ItemContainerGenerator.IndexFromContainer(DependencyObject) 方法

定义

注意

indexFromContainer 可能会在Windows 8.1后更改或不可用。 请改用 ItemsControl.IndexFromContainer

返回具有指定生成的容器的项的索引。

public:
 virtual int IndexFromContainer(DependencyObject ^ container) = IndexFromContainer;
/// [Windows.Foundation.Metadata.Deprecated("IndexFromContainer may be altered or unavailable for releases after Windows 8.1. Instead, use ItemsControl.IndexFromContainer.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Microsoft.UI.Xaml.WinUIContract")]
int IndexFromContainer(DependencyObject const& container);
[Windows.Foundation.Metadata.Deprecated("IndexFromContainer may be altered or unavailable for releases after Windows 8.1. Instead, use ItemsControl.IndexFromContainer.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Microsoft.UI.Xaml.WinUIContract")]
public int IndexFromContainer(DependencyObject container);
function indexFromContainer(container)
Public Function IndexFromContainer (container As DependencyObject) As Integer

参数

container
DependencyObject

要检索其项索引的生成的容器。

返回

Int32

int

对应于指定生成的容器的项的索引。

属性

适用于