Class SitecoreLayoutBindingSource

Version: 21.x

Utilities for binding Sitecore layout data.

Inheritance

System.Object

SitecoreLayoutBindingSource

SitecoreLayoutComponentBindingSource

SitecoreLayoutComponentFieldBindingSource

SitecoreLayoutComponentFieldsBindingSource

SitecoreLayoutComponentPropertyBindingSource

SitecoreLayoutContextBindingSource

SitecoreLayoutContextPropertyBindingSource

SitecoreLayoutResponseBindingSource

SitecoreLayoutRouteBindingSource

SitecoreLayoutRouteFieldBindingSource

SitecoreLayoutRouteFieldsBindingSource

SitecoreLayoutRoutePropertyBindingSource

Namespace: Sitecore.AspNet.RenderingEngine.Binding.Sources

Assembly: Sitecore.AspNet.RenderingEngine.dll

Syntax
public abstract class SitecoreLayoutBindingSource : BindingSource

Constructors

SitecoreLayoutBindingSource(String, String, Boolean, Boolean)

Initializes a new instance of the SitecoreLayoutBindingSource class.

Declaration
protected SitecoreLayoutBindingSource(string id, string displayName, bool isGreedy, bool isFromRequest)
Parameters
TypeNameDescription
System.StringidThe binding source ID.
System.StringdisplayNameThe display name.
System.BooleanisGreedyA value indicating whether the source is greedy.
System.BooleanisFromRequestA value indicating whether the data comes from the HTTP request.

Properties

Name

Gets or sets the binding source name.

Declaration
public string Name { get; set; }
Property Value
TypeDescription
System.String

Methods

GetFieldModel(ModelBindingContext, T, Route)

Get the value of an object's field.

Declaration

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

Parameters
TypeNameDescription
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContextbindingContextThe Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.
TsourceThe source object to process.
RoutecurrentRouteThe route for the current page.
Returns
TypeDescription
System.ObjectA field object.
Type Parameters
NameDescription
TThe type of the source object.

GetModel(IServiceProvider, ModelBindingContext, ISitecoreRenderingContext)

Gets the model for binding.

Declaration
public abstract object GetModel(IServiceProvider serviceProvider, ModelBindingContext bindingContext, ISitecoreRenderingContext context)
Parameters
TypeNameDescription
System.IServiceProviderserviceProviderThe System.IServiceProvider.
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContextbindingContextThe Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.
ISitecoreRenderingContextcontextThe ISitecoreRenderingContext.
Returns
TypeDescription
System.ObjectThe bound model.

GetPropertyModel(ModelBindingContext, T)

Gets the value of an object's property.

Declaration

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

Parameters
TypeNameDescription
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContextbindingContextThe Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.
TsourceThe source object to process.
Returns
TypeDescription
System.ObjectA property object.
Type Parameters
NameDescription
TThe type of the source object.
If you have suggestions for improving this article, let us know!