-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce AlloyContentAreaItemRenderer and refactor
- Loading branch information
Showing
7 changed files
with
42 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 0 additions & 55 deletions
55
templates/Alloy.Mvc/Business/Rendering/AlloyContentAreaRenderer.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Alloy.Mvc._1.Business.Rendering; | ||
using EPiServer.ServiceLocation; | ||
using Microsoft.AspNetCore.Mvc.Razor; | ||
using Microsoft.AspNetCore.Razor.TagHelpers; | ||
|
||
namespace Alloy.Mvc._1.Views; | ||
|
||
public abstract class AlloyPageBase<TModel> : RazorPage<TModel> where TModel : class | ||
{ | ||
private readonly AlloyContentAreaItemRenderer _alloyContentAreaItemRenderer; | ||
|
||
public abstract override Task ExecuteAsync(); | ||
|
||
public AlloyPageBase() : this(ServiceLocator.Current.GetInstance<AlloyContentAreaItemRenderer>()) | ||
{ | ||
} | ||
|
||
public AlloyPageBase(AlloyContentAreaItemRenderer alloyContentAreaItemRenderer) | ||
{ | ||
_alloyContentAreaItemRenderer = alloyContentAreaItemRenderer; | ||
} | ||
|
||
protected void OnItemRendered(ContentAreaItem contentAreaItem, TagHelperContext context, TagHelperOutput output) | ||
{ | ||
_alloyContentAreaItemRenderer.RenderContentAreaItemCss(contentAreaItem, context, output); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters