Table of Contents

Class TemplateBoxBase

Namespace
Nalu
Assembly
Nalu.Maui.Layouts.dll

A ViewBox base class that uses a DataTemplate to render content.

[ContentProperty("TemplateContent")]
public abstract class TemplateBoxBase : ClippableViewBoxBase, INotifyPropertyChanged, IVisualTreeElement, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IViewController, IVisualElementController, IElementController, IGestureController, IGestureRecognizers, IPropertyMapperView, IHotReloadableView, IReplaceableView, ISafeAreaView, IViewBox, IContentView, IView, IElement, ITransform, IPadding, ICrossPlatformLayout
Inheritance
TemplateBoxBase
Implements
Derived
Inherited Members

Fields

TemplateContentProperty

Bindable property for TemplateContent property.

public static readonly BindableProperty TemplateContentProperty

Field Value

BindableProperty

Properties

ActualTemplate

Gets the current template used to render content.

protected DataTemplate? ActualTemplate { get; }

Property Value

DataTemplate

Remarks

Matches the Template property unless a DataTemplateSelector is used.

Template

Gets the active template.

protected DataTemplate? Template { get; }

Property Value

DataTemplate

TemplateContent

Gets or sets the content to be projected through TemplateContentPresenter component.

public IView? TemplateContent { get; set; }

Property Value

IView

Methods

ContentBindingContextPropertyChanged(object?, object?)

Updates the binding context of the content view.

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

Parameters

oldvalue object

The old BindingContext.

newvalue object

The new BindingContext.

OnBindingContextChanged()

Invoked whenever the binding context of the View changes.

protected override void OnBindingContextChanged()

Remarks

This method can be overridden to add class handling for this event. Overrides must call the base method.

OnContentPropertyChanged(IView?, IView?)

Sets the content of the layout.

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

Parameters

oldView IView

The old content.

newView IView

The new content.

SetTemplate(DataTemplate?)

Sets the template to use for rendering content.

protected void SetTemplate(DataTemplate? dataTemplate)

Parameters

dataTemplate DataTemplate

The DataTemplate or DataTemplateSelector to use.