Class MBTabBar<TItem>
This is a general purpose Material Theme tab bar.
public class MBTabBar<TItem> : InputComponent<int>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Type Parameters
TItem
- Inheritance
-
MBTabBar<TItem>
- Implements
- Inherited Members
Constructors
MBTabBar()
public MBTabBar()
Properties
Density
The tab bar's density.
[Parameter]
public MBDensity? Density { get; set; }
Property Value
GetKeysFunc
A function delegate to return the parameters for @key
attributes. If unused
"fake" keys set to GUIDs will be used.
[Parameter]
public Func<TItem, object> GetKeysFunc { get; set; }
Property Value
Icon
Icon render fragments requiring correct icon markup including the "mdc-tab__icon" CSS class. Note that Material Icons always render properly, while some wider Font Awesome icons for instance render too close to the tab text.
[Parameter]
public RenderFragment<TItem> Icon { get; set; }
Property Value
- RenderFragment<TItem>
Items
The list of items for the tab bar.
[Parameter]
public IEnumerable<TItem> Items { get; set; }
Property Value
- IEnumerable<TItem>
Label
Label render fragments.
[Parameter]
public RenderFragment<TItem> Label { get; set; }
Property Value
- RenderFragment<TItem>
StackIcons
Stack icons vertically if True, otherwise icons are leading.
[Parameter]
public bool StackIcons { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
Dispose(bool)
protected override void Dispose(bool disposing)
Parameters
disposing
bool
NotifyActivated(int)
For Material Theme to notify when a tab is clicked via JS Interop.
[JSInvokable]
public void NotifyActivated(int index)
Parameters
index
int
OnInitializedAsync()
protected override Task OnInitializedAsync()
Returns
OnParametersSetAsync()
When overriding this, call await base.OnParametersSetAsync();
before any user code unless there is a very good reason not to.
protected override Task OnParametersSetAsync()