Table of Contents

Class ViewBoxBase

Namespace
Nalu
Assembly
Nalu.Maui.Layouts.dll

ViewBoxBase is a base class a IViewBox that is used to display a single view.

public abstract class ViewBoxBase : View, INotifyPropertyChanged, IVisualTreeElement, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IViewController, IVisualElementController, IElementController, IGestureController, IGestureRecognizers, IPropertyMapperView, IHotReloadableView, IReplaceableView, IViewBox, IContentView, IView, IElement, ITransform, IPadding, ICrossPlatformLayout, ISafeAreaView
Inheritance
ViewBoxBase
Implements
Derived
Inherited Members

Fields

ContentBindingContextProperty

Bindable property for ContentBindingContext property.

public static readonly BindableProperty ContentBindingContextProperty

Field Value

BindableProperty

PaddingProperty

Bindable property for Padding property.

public static readonly BindableProperty PaddingProperty

Field Value

BindableProperty

Properties

ContentBindingContext

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

public object? ContentBindingContext { get; set; }

Property Value

object

Examples

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

Remarks

This helps to fulfill interface segregation principle by allowing the content view to be bound to a property of the parent's binding context.

Padding

Gets or sets the padding around the content.

public Thickness Padding { get; set; }

Property Value

Thickness

PresentedContent

Gets the content of this view as it will be rendered in the user interface, including any transformations or applied templates.

public IView? PresentedContent { get; }

Property Value

IView

Methods

ContentBindingContextPropertyChanged(object?, object?)

Updates the binding context of the content view.

protected virtual void ContentBindingContextPropertyChanged(object? oldvalue, object? newvalue)

Parameters

oldvalue object

The old BindingContext.

newvalue object

The new BindingContext.

CreateLayoutManager()

Creates a manager object that can measure this container and arrange its content.

protected virtual ILayoutManager CreateLayoutManager()

Returns

ILayoutManager

The instance of the layout manager.

GetContent()

Gets the content.

protected virtual IView? GetContent()

Returns

IView

OnContentPropertyChanged(IView?, IView?)

Sets the content of the layout.

protected virtual void OnContentPropertyChanged(IView? oldView, IView? newView)

Parameters

oldView IView

The old content.

newView IView

The new content.

OnPaddingPropertyChanged(Thickness, Thickness)

Triggered when the Padding property changes.

protected virtual void OnPaddingPropertyChanged(Thickness oldValue, Thickness newValue)

Parameters

oldValue Thickness

The old padding.

newValue Thickness

The new padding.

SetContent(IView?)

Sets the content.

protected virtual void SetContent(IView? content)

Parameters

content IView

The new content.

TriggerContentChanged(IView?, IView?)

Triggers the ContentChanged event.

protected void TriggerContentChanged(IView? oldView, IView? newView)

Parameters

oldView IView
newView IView

Events

ContentChanged

Triggered when the content changes.

public event EventHandler<ViewBoxContentChangedEventArgs>? ContentChanged

Event Type

EventHandler<ViewBoxContentChangedEventArgs>