Back to Devexpress

DxCarousel.AllowMouseWheel Property

blazor-devexpress-dot-blazor-dot-dxcarousel-daceb441.md

latest1.9 KB
Original Source

DxCarousel.AllowMouseWheel Property

Specifies whether users can scroll the mouse wheel to switch Carousel slides (items).

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(false)]
[Parameter]
public bool AllowMouseWheel { get; set; }

Property Value

TypeDefaultDescription
Booleanfalse

true if users can scroll the mouse wheel to switch slides; otherwise, false.

|

Remarks

Enable the AllowMouseWheel property to allow users to switch Carousel slides with the mouse wheel.

razor
<DxCarousel Width="500px"
            Height="300px"
            Data="@GetCarouselData()"
            AllowMouseWheel="true"
            LoopNavigationEnabled="true"
            ImageSizeMode="CarouselImageSizeMode.FillAndCrop">
</DxCarousel>

@code {
    List<CarouselData> GetCarouselData() {
        List<CarouselData> result = new List<CarouselData>();
        result.Add(new CarouselData("../images/image1.jpg", "image 1"));
        result.Add(new CarouselData("../images/image2.jpg", "image 2"));
        result.Add(new CarouselData("../images/image3.jpg", "image 3"));
        result.Add(new CarouselData("../images/image4.jpg", "image 4"));

        return result;
    }

    public class CarouselData {
        public string Source { get; set; }
        public string AlternateText { get; set; }

        public CarouselData(string source, string alt) {
            Source = source;
            AlternateText = alt;
        }
    }
}

See Also

DxCarousel Class

DxCarousel Members

DevExpress.Blazor Namespace