Class MudCarousel<TData>
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Represents a set of slides which transition after a delay.
public class MudCarousel<TData> : MudBaseBindableItemsControl<MudCarouselItem, TData>, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IAsyncDisposable
Type Parameters
TData
The kind of item to display.
- Inheritance
-
MudCarousel<TData>
- Implements
- Inherited Members
- Extension Methods
Constructors
MudCarousel()
public MudCarousel()
Properties
ArrowsPosition
The position where the arrows are displayed, if ShowArrows is true
.
[Parameter]
[Category("Appearance")]
public Position ArrowsPosition { get; set; }
Property Value
Remarks
Defaults to Center.
AutoCycle
Automatically cycles items based on AutoCycleTime.
[Parameter]
[Category("Behavior")]
public bool AutoCycle { get; set; }
Property Value
Remarks
Defaults to false
. When true
, the MudCarouselItem items will be rotated after the delay specified in AutoCycleTime.
AutoCycleTime
The delay before displaying the next MudCarouselItem when AutoCycle is true
.
[Parameter]
[Category("Behavior")]
public TimeSpan AutoCycleTime { get; set; }
Property Value
Remarks
Defaults to Zero.
BulletTemplate
The custom template for bullets.
[Category("Appearance")]
[Parameter]
public RenderFragment<bool>? BulletTemplate { get; set; }
Property Value
Remarks
When set, the template will be used and the CheckedIcon and UncheckedIcon properties will be ignored.
BulletsButtonsClassName
protected string BulletsButtonsClassName { get; }
Property Value
BulletsClass
The custom CSS classes for bullets when ShowBullets is true
.
[Category("Appearance")]
[Parameter]
public string? BulletsClass { get; set; }
Property Value
Remarks
Defaults to null
. Separate each CSS class with spaces.
BulletsColor
The color of bullets when ShowBullets is true
.
[Parameter]
[Category("Appearance")]
public Color? BulletsColor { get; set; }
Property Value
Remarks
Defaults to null
. When null
the Color property is used.
BulletsPosition
The location of the bullets when ShowBullets is true
.
[Parameter]
[Category("Appearance")]
public Position BulletsPosition { get; set; }
Property Value
Remarks
Defaults to Bottom.
CheckedIcon
The icon displayed for the current MudCarouselItem when no BulletTemplate is set.
[Parameter]
[Category("Appearance")]
public string CheckedIcon { get; set; }
Property Value
Classname
protected string Classname { get; }
Property Value
EnableSwipeGesture
Allows swipe gestures for touch devices.
[Category("Behavior")]
[Parameter]
public bool EnableSwipeGesture { get; set; }
Property Value
Remarks
Defaults to true
. When true
, swipe gestures on touch devices can be used to change the current MudCarouselItem.
NavigationButtonsClass
The custom CSS classes for the "Next" and "Previous" icons when ShowArrows is true
.
[Parameter]
[Category("Appearance")]
public string? NavigationButtonsClass { get; set; }
Property Value
Remarks
Defaults to null
. Separate each CSS class with spaces.
NavigationButtonsClassName
protected string NavigationButtonsClassName { get; }
Property Value
NextButtonTemplate
The custom template for the "Next" button.
[Parameter]
[Category("Appearance")]
public RenderFragment? NextButtonTemplate { get; set; }
Property Value
NextIcon
The "Next" button icon when ShowBullets is true
and no NextButtonTemplate is set.
[Parameter]
[Category("Appearance")]
public string NextIcon { get; set; }
Property Value
Remarks
Defaults to NavigateNext.
PreviousButtonTemplate
The custom template for the "Previous" button.
[Parameter]
[Category("Appearance")]
public RenderFragment? PreviousButtonTemplate { get; set; }
Property Value
PreviousIcon
The "Previous" button icon when ShowBullets is true
and no PreviousButtonTemplate is set.
[Parameter]
[Category("Appearance")]
public string PreviousIcon { get; set; }
Property Value
Remarks
Defaults to NavigateBefore.
RightToLeft
[CascadingParameter(Name = "RightToLeft")]
public bool RightToLeft { get; set; }
Property Value
ShowArrows
Displays "Next" and "Previous" arrows.
[Parameter]
[Category("Behavior")]
public bool ShowArrows { get; set; }
Property Value
ShowBullets
Displays a bullet for each MudCarouselItem.
[Parameter]
[Category("Behavior")]
public bool ShowBullets { get; set; }
Property Value
Remarks
Defaults to true
.
UncheckedIcon
The icon displayed for unselected MudCarouselItems when no BulletTemplate is set.
[Parameter]
[Category("Appearance")]
public string UncheckedIcon { get; set; }
Property Value
Methods
AddItem(MudCarouselItem)
When overridden, adds an item to the list.
public override void AddItem(MudCarouselItem item)
Parameters
item
MudCarouselItemThe item to add.
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
DisposeAsync()
public ValueTask DisposeAsync()
Returns
DisposeAsyncCore()
protected virtual ValueTask DisposeAsyncCore()
Returns
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
SelectionChanged()
Occurs when the SelectedIndex
has changed.
protected override void SelectionChanged()