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
Properties
ActualTemplate
Gets the current template used to render content.
protected DataTemplate? ActualTemplate { get; }
  Property Value
Remarks
Matches the Template property unless a DataTemplateSelector is used.
Template
Gets the active template.
protected DataTemplate? Template { get; }
  Property Value
TemplateContent
Gets or sets the content to be projected through TemplateContentPresenter component.
public IView? TemplateContent { get; set; }
  Property Value
Methods
ContentBindingContextPropertyChanged(object?, object?)
Updates the binding context of the content view.
protected override void ContentBindingContextPropertyChanged(object? oldvalue, object? newvalue)
  Parameters
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
SetTemplate(DataTemplate?)
Sets the template to use for rendering content.
protected void SetTemplate(DataTemplate? dataTemplate)
  Parameters
dataTemplateDataTemplateThe DataTemplate or DataTemplateSelector to use.