Class MBSlidingContent<TItem>
A Plus component that take a set of renderfragments in a list and transitions from one to another with slight sideways motion and fade, or "sliding". Only renders the currently displayed item.
public class MBSlidingContent<TItem> : ComponentFoundation, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Type Parameters
TItem
The content type.
- Inheritance
-
MBSlidingContent<TItem>
- Implements
- Inherited Members
Constructors
MBSlidingContent()
public MBSlidingContent()
Properties
Content
Render fragment for each displayable item.
[Parameter]
public RenderFragment<TItem> Content { get; set; }
Property Value
- RenderFragment<TItem>
ItemIndex
The index of the currently displayed item.
[Parameter]
public int ItemIndex { get; set; }
Property Value
ItemIndexChanged
The change event callback for ItemIndex.
[Parameter]
public EventCallback<int> ItemIndexChanged { get; set; }
Property Value
Items
The items to be displayed.
[Parameter]
public IEnumerable<TItem> Items { get; set; }
Property Value
- IEnumerable<TItem>
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
OnAfterRenderAsync(bool)
Material.Blazor components generally should not override this because it handles the case where components need
to be adjusted when inside an MBDialog
or MBCard
.
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
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()
Returns
SlideNext(bool)
Moves to the next slide, always scrolling forwards.
public Task SlideNext(bool rollover)
Parameters
rollover
boolRolls from last to first if true, scrolling forwards.
Returns
SlidePrevious(bool)
Moves to the previous slide, always scrolling backwards.
public Task SlidePrevious(bool rollover)
Parameters
rollover
boolRolls from first to last if true, scrolling backwards.