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
stringThe binding source ID.
displayName
stringThe display name.
isGreedy
boolA value indicating whether the source is greedy.
isFromRequest
boolA 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
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
ModelBindingContextThe ModelBindingContext.
source
TThe source object to process.
currentRoute
RouteThe 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
IServiceProviderThe IServiceProvider.
bindingContext
ModelBindingContextThe ModelBindingContext.
context
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
ModelBindingContextThe ModelBindingContext.
source
TThe source object to process.
Returns
- object
A property object.
Type Parameters
T
The type of the source object.