Class MudBaseItemsControl<TChildComponent>
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Represents a base class for designing components which contain items.
public abstract class MudBaseItemsControl<TChildComponent> : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged where TChildComponent : MudComponentBase
Type Parameters
TChildComponent
The type of MudComponentBase managed by this component.
- Inheritance
-
MudBaseItemsControl<TChildComponent>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
MudBaseItemsControl()
protected MudBaseItemsControl()
Properties
ChildContent
The content within this component.
[Parameter]
[Category("Data")]
public RenderFragment? ChildContent { get; set; }
Property Value
Items
The list of items.
public List<TChildComponent> Items { get; }
Property Value
- List<TChildComponent>
Remarks
This property is ignored when ItemsSource
is not null.
LastContainer
The previously selected item.
public TChildComponent? LastContainer { get; }
Property Value
- TChildComponent
SelectedContainer
The currently selected item.
public TChildComponent? SelectedContainer { get; }
Property Value
- TChildComponent
Remarks
This property returns the item in the Items property at the SelectedIndex.
SelectedIndex
The index of the currently selected item.
[Parameter]
[Category("Behavior")]
public int SelectedIndex { get; set; }
Property Value
Remarks
When this property changes, the SelectedIndexChanged event occurs.
SelectedIndexChanged
Occurs when the SelectedIndex has changed.
[Parameter]
public EventCallback<int> SelectedIndexChanged { get; set; }
Property Value
Methods
AddItem(TChildComponent)
When overridden, adds an item to the list.
public virtual void AddItem(TChildComponent item)
Parameters
item
TChildComponentThe item to add.
MoveTo(int)
Changes the SelectedIndex to the specified value.
public void MoveTo(int index)
Parameters
index
int
Next()
Selects the next item.
public void Next()
Remarks
If the current SelectedIndex is the last item, the selection is changed to 0
.
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
Previous()
Selects the previous item.
public void Previous()
Remarks
If the current SelectedIndex is 0
, the selection is changed to the index of the last item.
SelectionChanged()
Occurs when the SelectedIndex has changed.
protected virtual void SelectionChanged()