---
title: "Class SitecoreLayoutBindingSource"
slug: "sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutbindingsource"
abstract: ""
---
# Class SitecoreLayoutBindingSource

Utilities for binding Sitecore layout data.

## Inheritance

System.Object

SitecoreLayoutBindingSource

[SitecoreLayoutComponentBindingSource](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutcomponentbindingsource.html)

[SitecoreLayoutComponentFieldBindingSource](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutcomponentfieldbindingsource.html)

[SitecoreLayoutComponentFieldsBindingSource](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutcomponentfieldsbindingsource.html)

[SitecoreLayoutComponentPropertyBindingSource](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutcomponentpropertybindingsource.html)

[SitecoreLayoutContextBindingSource](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutcontextbindingsource.html)

[SitecoreLayoutContextPropertyBindingSource](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutcontextpropertybindingsource.html)

[SitecoreLayoutResponseBindingSource](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutresponsebindingsource.html)

[SitecoreLayoutRouteBindingSource](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutroutebindingsource.html)

[SitecoreLayoutRouteFieldBindingSource](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutroutefieldbindingsource.html)

[SitecoreLayoutRouteFieldsBindingSource](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutroutefieldsbindingsource.html)

[SitecoreLayoutRoutePropertyBindingSource](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutroutepropertybindingsource.html)

### **Namespace**: Sitecore.AspNet.RenderingEngine.Binding.Sources

#### **Assembly**: Sitecore.AspNet.RenderingEngine.dll

##### Syntax

```csharp
public abstract class SitecoreLayoutBindingSource : BindingSource

```

### Constructors

#### SitecoreLayoutBindingSource(String, String, Boolean, Boolean)

Initializes a new instance of the [SitecoreLayoutBindingSource](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.sources.sitecorelayoutbindingsource.html) class.

##### Declaration

```csharp
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

```csharp
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

```csharp
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 | The [ISitecoreRenderingContext](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.isitecorerenderingcontext.html). |

##### 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. |
