Table of Contents

Class SitecoreLayoutBindingSource

Namespace
Sitecore.AspNetCore.SDK.RenderingEngine.Binding.Sources
Assembly
Sitecore.AspNetCore.SDK.RenderingEngine.dll

Utilities for binding Sitecore layout data.

public abstract class SitecoreLayoutBindingSource : BindingSource, IEquatable<BindingSource?>
Inheritance
SitecoreLayoutBindingSource
Implements
Derived
Inherited Members

Remarks

Initializes a new instance of the SitecoreLayoutBindingSource class.

Constructors

SitecoreLayoutBindingSource(string, string, bool, bool)

Utilities for binding Sitecore layout data.

protected SitecoreLayoutBindingSource(string id, string displayName, bool isGreedy, bool isFromRequest)

Parameters

id string

The binding source ID.

displayName string

The display name.

isGreedy bool

A value indicating whether the source is greedy.

isFromRequest bool

A value indicating whether the data comes from the HTTP request.

Remarks

Initializes a new instance of the SitecoreLayoutBindingSource class.

Properties

Name

Gets or sets the binding source name.

public string? Name { get; set; }

Property Value

string

Methods

GetFieldModel<T>(ModelBindingContext, T?, Route?)

Get the value of an object's field.

protected object? GetFieldModel<T>(ModelBindingContext bindingContext, T? source, Route? currentRoute) where T : IFieldsReader

Parameters

bindingContext ModelBindingContext

The ModelBindingContext.

source T

The source object to process.

currentRoute Route

The route for the current page.

Returns

object

A field object.

Type Parameters

T

The type of the source object.

GetModel(IServiceProvider, ModelBindingContext, ISitecoreRenderingContext)

Gets the model for binding.

public abstract object? GetModel(IServiceProvider serviceProvider, ModelBindingContext bindingContext, ISitecoreRenderingContext context)

Parameters

serviceProvider IServiceProvider

The IServiceProvider.

bindingContext ModelBindingContext

The ModelBindingContext.

context ISitecoreRenderingContext

The ISitecoreRenderingContext.

Returns

object

The bound model.

GetPropertyModel<T>(ModelBindingContext, T?)

Gets the value of an object's property.

protected object? GetPropertyModel<T>(ModelBindingContext bindingContext, T? source) where T : class

Parameters

bindingContext ModelBindingContext

The ModelBindingContext.

source T

The source object to process.

Returns

object

A property object.

Type Parameters

T

The type of the source object.