Class RepliesView
A simple replies container backed by a ScrollView. Drop-in replacement for the subset of ListView used by Thread: supports makeItem / bindItem / unbindItem / destroyItem, an itemsSource, and a manual RefreshItems(). Items are realized eagerly — there is no virtualization — which keeps the layout stable inside popovers where dynamic-height ListView constantly relayouts itself.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class RepliesView : ScrollView, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle
Constructors
RepliesView()
Initializes a new instance of RepliesView with vertical scrolling and no horizontal scrollbar.
Declaration
public RepliesView()
Properties
bindItem
Callback invoked to bind data from itemsSource at the given index to the supplied visual element.
Declaration
public Action<VisualElement, int> bindItem { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<VisualElement, int> |
destroyItem
Callback invoked to dispose of a visual element that is no longer needed.
Declaration
public Action<VisualElement> destroyItem { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<VisualElement> |
itemsSource
The data source that drives the list. Call RefreshItems() after changing the source or its contents to update the view.
Declaration
public IList itemsSource { get; set; }
Property Value
| Type | Description |
|---|---|
| IList |
makeItem
Callback invoked to create a new item visual element when the list needs one.
Declaration
public Func<VisualElement> makeItem { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<VisualElement> |
selectionType
Accepted for API compatibility with ListView but has no effect; RepliesView does not support item selection.
Declaration
public SelectionType selectionType { get; set; }
Property Value
| Type | Description |
|---|---|
| SelectionType |
unbindItem
Callback invoked to release any bindings on a visual element before it is destroyed or recycled.
Declaration
public Action<VisualElement, int> unbindItem { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<VisualElement, int> |
virtualizationMethod
Accepted for API compatibility with ListView but has no effect; RepliesView always realizes items eagerly.
Declaration
public CollectionVirtualizationMethod virtualizationMethod { get; set; }
Property Value
| Type | Description |
|---|---|
| CollectionVirtualizationMethod |
Methods
GetRootElementForIndex(int)
Returns the root visual element for the item at index,
or null if the index is out of range.
Declaration
public VisualElement GetRootElementForIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Zero-based index into itemsSource. |
Returns
| Type | Description |
|---|---|
| VisualElement | The realized VisualElement for that index, or |
RefreshItems()
Destroys all current item elements and recreates them from itemsSource using makeItem and bindItem.
Declaration
public void RefreshItems()