Table of Contents

Class Carousel

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll

An items control that displays its items as pages that fill the control.

public class Carousel : SelectingItemsControl, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue, IChildIndexProvider
Inheritance
Carousel
Implements
Inherited Members
Extension Methods

Constructors

public Carousel()

Fields

Defines the PageTransition property.

public static readonly StyledProperty<IPageTransition?> PageTransitionProperty

Field Value

StyledProperty<IPageTransition>

Properties

Gets or sets the transition to use when moving between pages.

public IPageTransition? PageTransition { get; set; }

Property Value

IPageTransition

Methods

Positions child elements as part of a layout pass.

protected override Size ArrangeOverride(Size finalSize)

Parameters

finalSize Size

The size available to the control.

Returns

Size

The actual size used.

Moves to the next item in the carousel.

public void Next()

Called when the control's template is applied. In simple terms, this means the method is called just before the control is displayed.

protected override void OnApplyTemplate(TemplateAppliedEventArgs e)

Parameters

e TemplateAppliedEventArgs

The event args.

Called when a avalonia property changes on the object.

protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)

Parameters

change AvaloniaPropertyChangedEventArgs

The property change details.

Moves to the previous item in the carousel.

public void Previous()