Table of Contents

Class SlideBoxItem

Namespace
Nalu
Assembly
Nalu.Maui.Layouts.dll

A slide of a SlideBox: a lazily-realized DataTemplate with a participation flag.

[ContentProperty("Template")]
public sealed class SlideBoxItem : Element, INotifyPropertyChanged, IElementController, IVisualTreeElement, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IElement
Inheritance
SlideBoxItem
Implements
Inherited Members
Extension Methods

Remarks

The template is realized the first time the slide is presented (or becomes the neighbor of an active swipe) and the created content is retained from then on, preserving its state across navigation. Disabling the slide excludes it from the sequence AND tears the realized content down — re-enabling rebuilds it lazily on the next visit.

Fields

ContentBindingContextProperty

Bindable property for ContentBindingContext.

public static readonly BindableProperty ContentBindingContextProperty

Field Value

BindableProperty

IsEnabledProperty

Bindable property for IsEnabled.

public static readonly BindableProperty IsEnabledProperty

Field Value

BindableProperty

TemplateProperty

Bindable property for Template.

public static readonly BindableProperty TemplateProperty

Field Value

BindableProperty

Properties

Content

Gets the realized content, or null while the slide has never been presented (or is disabled).

public View? Content { get; }

Property Value

View

ContentBindingContext

Gets or sets the BindingContext to force on the realized content.

public object? ContentBindingContext { get; set; }

Property Value

object

Examples

<nalu:SlideBoxItem ContentBindingContext="{Binding CurrentAnimal}">
    <DataTemplate>
        <AnimalView x:DataType="models:Animal" />
    </DataTemplate>
</nalu:SlideBoxItem>

Remarks

This helps to fulfill interface segregation principle by allowing the slide's content to be bound to a property of the parent's binding context. Applied when the template is realized and whenever the value changes; cleared when the content is torn down.

IsEnabled

Gets or sets whether the slide participates in the sequence. Disabled slides are skipped by swipes and Next()/Previous(), and their realized content is torn down.

public bool IsEnabled { get; set; }

Property Value

bool

Template

Gets or sets the lazy factory of the slide's content.

public DataTemplate? Template { get; set; }

Property Value

DataTemplate