Class SitecoreLayoutBindingSource
Utilities for binding Sitecore layout data.
Inheritance
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
Type | Name | Description |
---|---|---|
System.String | id | The binding source ID. |
System.String | displayName | The display name. |
System.Boolean | isGreedy | A value indicating whether the source is greedy. |
System.Boolean | isFromRequest | A 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
Type | Description |
---|---|
System.String |
Methods
GetFieldModel<T>(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
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext | bindingContext | The Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext. |
T | source | The source object to process. |
Route | currentRoute | The route for the current page. |
Returns
Type | Description |
---|---|
System.Object | A field object. |
Type Parameters
Name | Description |
---|---|
T | The 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
Type | Name | Description |
---|---|---|
System.IServiceProvider | serviceProvider | The System.IServiceProvider. |
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext | bindingContext | The Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext. |
ISitecoreRenderingContext | context |
Returns
Type | Description |
---|---|
System.Object | The bound model. |
GetPropertyModel<T>(ModelBindingContext, T)
Gets the value of an object's property.
Declaration
protected object GetPropertyModel<T>(ModelBindingContext bindingContext, T source)
where T : class
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext | bindingContext | The Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext. |
T | source | The source object to process. |
Returns
Type | Description |
---|---|
System.Object | A property object. |
Type Parameters
Name | Description |
---|---|
T | The type of the source object. |