ListViewPersistenceHelper 클래스

정의

ListView의 상대 스크롤 위치를 저장하고 검색할 도우미 클래스를 나타냅니다.

public ref class ListViewPersistenceHelper sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ListViewPersistenceHelper final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ListViewPersistenceHelper
Public NotInheritable Class ListViewPersistenceHelper
상속
Object Platform::Object IInspectable ListViewPersistenceHelper
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

전체 구현은 ListView 및 GridView 샘플 리포지토리의 [스크롤 위치 복원 샘플]https://github.com/microsoft/Windows-universal-samples/blob/main/Samples/XamlListView/cs/Scenario5_RestoreScrollPosition.xaml.cs)을 참조하세요.

설명

ItemsStackPanel.ItemsUpdatingScrollMode 속성이 KeepItemsInView로 설정된 경우 ListViewPersistenceHelper는 표시되는 첫 번째 항목의 키를 사용하여 스크롤 위치를 복원하려고 시도합니다. ItemsUpdatingScrollModeKeepLastItemInView인 경우 마지막으로 표시되는 항목의 키를 사용하여 스크롤 위치를 복원하려고 시도합니다.

메서드

GetRelativeScrollPosition(ListViewBase, ListViewItemToKeyHandler)

ListView의 상대 스크롤 위치를 검색합니다.

SetRelativeScrollPositionAsync(ListViewBase, String, ListViewKeyToItemHandler)

ListView의 상대 스크롤 위치를 설정하는 비동기 작업을 시작합니다.

적용 대상