ListViewPersistenceHelper クラス

定義

ListView の相対スクロール位置を保存および取得するヘルパー クラスを表します。

public ref class ListViewPersistenceHelper sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 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(Microsoft.UI.Xaml.WinUIContract), 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
属性

完全な実装については、ListView と GridView サンプル リポジトリスクロール位置の復元のサンプルを参照してください。

注釈

ItemsStackPanel.ItemsUpdatingScrollMode プロパティが KeepItemsInView に設定されている場合、ListViewPersistenceHelper は最初に表示される項目のキーを使用してスクロール位置の復元を試みます。 ItemsUpdatingScrollModeKeepLastItemInView の場合、最後に表示された項目のキーを使用してスクロール位置の復元を試みます。

メソッド

GetRelativeScrollPosition(ListViewBase, ListViewItemToKeyHandler)

ListView の相対スクロール位置を取得します。

SetRelativeScrollPositionAsync(ListViewBase, String, ListViewKeyToItemHandler)

ListView の相対スクロール位置を設定する非同期アクションを開始します。

適用対象

こちらもご覧ください

  • <xref:Microsoft.UI.Xaml.Controls.ListView%0a%2b+%5bListView+and+GridView%5d(%2fwindows%2fuwp%2fcontrols-and-patterns%2flistview-and-gridview)>