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 の相対スクロール位置を設定する非同期アクションを開始します。

適用対象