Class SlideBox
- Namespace
- Nalu
- Assembly
- Nalu.Maui.Layouts.dll
A pager presenting one of an ordered set of lazily-realized, state-retaining slides, with animated index navigation, optional interactive swiping and neighbor peeking.
[ContentProperty("Items")]
public class SlideBox : Layout, INotifyPropertyChanged, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IViewController, IVisualElementController, IElementController, IGestureController, IGestureRecognizers, IPropertyMapperView, IHotReloadableView, IReplaceableView, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IBindableLayout, IVisualTreeElement
- Inheritance
-
SlideBox
- Implements
- Inherited Members
- Extension Methods
Remarks
Each SlideBoxItem's template is realized on first presentation and retained forever after — slide state survives navigation. Disabling an item excludes it from the sequence and tears its content down (re-enabling rebuilds lazily).
With a non-zero PeekAreaInsets the adjacent enabled slides stay partially visible at rest (and are therefore realized eagerly); with no peek they materialize only when presented or when a swipe starts.
Constructors
SlideBox()
Initializes a new instance of the SlideBox class.
public SlideBox()
Fields
IsSwipeEnabledProperty
Bindable property for IsSwipeEnabled.
public static readonly BindableProperty IsSwipeEnabledProperty
Field Value
OrientationProperty
Bindable property for Orientation.
public static readonly BindableProperty OrientationProperty
Field Value
PeekAreaInsetsProperty
Bindable property for PeekAreaInsets.
public static readonly BindableProperty PeekAreaInsetsProperty
Field Value
SelectedIndexProperty
Bindable property for SelectedIndex.
public static readonly BindableProperty SelectedIndexProperty
Field Value
SelectedItemProperty
Bindable property for SelectedItem.
public static readonly BindableProperty SelectedItemProperty
Field Value
TransitionDurationProperty
Bindable property for TransitionDuration.
public static readonly BindableProperty TransitionDurationProperty
Field Value
TransitionEasingProperty
Bindable property for TransitionEasing.
public static readonly BindableProperty TransitionEasingProperty
Field Value
Properties
IsSwipeEnabled
Gets or sets whether the user can swipe between adjacent slides.
public bool IsSwipeEnabled { get; set; }
Property Value
Items
Gets the slides.
public IList<SlideBoxItem> Items { get; }
Property Value
Orientation
Gets or sets the sliding axis.
public SlideBoxOrientation Orientation { get; set; }
Property Value
PeekAreaInsets
Gets or sets how much of the adjacent slides stays visible at rest (Left/Right for Horizontal, Top/Bottom for vertical).
public Thickness PeekAreaInsets { get; set; }
Property Value
SelectedIndex
Gets or sets the selected slide index within the FULL item list. Values pointing at a disabled item are coerced to the nearest enabled one (-1 when no enabled item exists).
public int SelectedIndex { get; set; }
Property Value
SelectedItem
Gets the currently selected item, or null.
public SlideBoxItem? SelectedItem { get; }
Property Value
TransitionDuration
Gets or sets the slide transition duration in milliseconds.
public uint TransitionDuration { get; set; }
Property Value
TransitionEasing
Gets or sets the slide transition easing.
public Easing TransitionEasing { get; set; }
Property Value
Methods
ArrangeOverride(Rect)
Allows subclasses to implement custom Arrange logic during a controls layout pass.
protected override Size ArrangeOverride(Rect bounds)
Parameters
boundsRectThe new bounds of the element.
Returns
- Size
The resulting size of this element's frame by the platform.
Remarks
Subclasses will still want to call ArrangeOverride(Rect) on the base class or call PlatformArrange(Rect) on the Handler .
CreateLayoutManager()
Creates a manager object that can measure this layout and arrange its children.
protected override ILayoutManager CreateLayoutManager()
Returns
- ILayoutManager
An object that implements ILayoutManager that manages this layout.
Next()
Moves to the nearest enabled slide after the current one. Returns false at the end.
public bool Next()
Returns
Previous()
Moves to the nearest enabled slide before the current one. Returns false at the start.
public bool Previous()
Returns
Events
SelectedIndexChanged
Raised after the selection changed (before the transition animation completes).
public event EventHandler<SlideBoxSelectionChangedEventArgs>? SelectedIndexChanged