using Iceshrimp.Shared.Schemas; namespace Iceshrimp.Frontend.Core.Services.StateServicePatterns; public class VirtualScroller { private Dictionary States { get; } = new(); public void SetState(string id, VirtualScrollerState state) { States[id] = state; } public VirtualScrollerState GetState(string id) { States.TryGetValue(id, out var state); return state ?? throw new ArgumentException($"Requested state '{id}' does not exist."); } } public class VirtualScrollerState { public List RenderedList = []; public Dictionary Height = new(); public int PadTop = 0; public int PadBottom = 0; public float ScrollTop = 0; }