BaseVirtualPanelclass
Base class for virtualized, scrollable panels that only create item panels when visible.
Constructors1
Showing 1 constructors
protected BaseVirtualPanel()
Initializes the base virtual panel with default styles.
No results match this filter.
Methods15
Showing 15 methods
public void AddItem(object item)
Adds a single item and marks the panel for rebuild.
| Parameter | Type | Description |
|---|---|---|
| item | object | The item to append. |
void—public void AddItems(System.Collections.Generic.IEnumerable`1<object> items)
| Parameter | Type | Description |
|---|---|---|
| items | IEnumerable<object> | — |
void—public void Clear()
Clears all items and destroys created panels.
void—protected virtual void FinalLayoutChildren(Vector2 offset)
Final layout pass for child panels and scroll bounds.
| Parameter | Type | Description |
|---|---|---|
| offset | Vector2 | Layout offset. |
void—protected virtual float GetTotalHeight(int itemCount)
Gets the total height needed to display the specified number of items.
| Parameter | Type | Description |
|---|---|---|
| itemCount | int | Number of items. |
floatTotal height in layout units.protected virtual void GetVisibleRange(int first, int pastEnd)
Gets the range of visible item indices.
| Parameter | Type | Description |
|---|---|---|
| first | int | First visible index (inclusive). |
| pastEnd | int | Past-the-end index (exclusive). |
void—public bool HasData(int i)
Returns true if `i` is a valid item index.
| Parameter | Type | Description |
|---|---|---|
| i | int | Item index. |
boolTrue if within bounds; otherwise false.public void InsertItem(int index, object item)
Inserts an item at the specified index and marks the panel for rebuild.
| Parameter | Type | Description |
|---|---|---|
| index | int | The zero-based index at which item should be inserted. |
| item | object | The item to insert. |
void—protected virtual void PositionPanel(int index, Sandbox.UI.Panel panel)
Positions a panel at the specified index.
| Parameter | Type | Description |
|---|---|---|
| index | int | Item index. |
| panel | Panel | Panel to position. |
void—public void RemoveAt(int index)
Removes the item at the specified index and marks the panel for rebuild.
| Parameter | Type | Description |
|---|---|---|
| index | int | The zero-based index of the item to remove. |
void—public bool RemoveItem(object item)
Removes the first occurrence of a specific item and marks the panel for rebuild.
| Parameter | Type | Description |
|---|---|---|
| item | object | The item to remove. |
boolTrue if item was found and removed; otherwise false.public void SetItems(System.Collections.Generic.IEnumerable`1<object> enumerable)
| Parameter | Type | Description |
|---|---|---|
| enumerable | IEnumerable<object> | — |
void—public virtual void Tick()
Per-frame update: adjusts spacing from CSS, updates layout, creates/destroys visible panels.
void—protected virtual bool UpdateLayout()
Updates the layout and returns true if the layout changed.
boolTrue if layout was updated; otherwise false.No results match this filter.
Properties6
Showing 6 properties
public Microsoft.AspNetCore.Components.RenderFragment`1<object> Sandbox.UI.BaseVirtualPanel.Item { get; set; }
Template used to render an item into a cell panel.
RenderFragment<object>—public int Sandbox.UI.BaseVirtualPanel.ItemCount { get; set; }
Gets the number of items in the panel.
int—public System.Collections.Generic.IEnumerable`1<object> Sandbox.UI.BaseVirtualPanel.Items { get; set; }
Replaces the current items. Only triggers a rebuild if the sequence is actually different. When set to an IList (like List), changes to the source list will be automatically detected.
IEnumerable<object>—public bool Sandbox.UI.BaseVirtualPanel.NeedsRebuild { get; set; }
When true, forces a layout rebuild on the next `Sandbox.UI.BaseVirtualPanel.Tick`.
bool—public System.Action`2<Sandbox.UI.Panel,object> Sandbox.UI.BaseVirtualPanel.OnCreateCell { get; set; }
Called when a cell is created. Allows you to fill the cell in
public System.Action Sandbox.UI.BaseVirtualPanel.OnLastCell { get; set; }
Called when the last cell has been viewed. This allows you to view more.
Action—No results match this filter.