Created
January 13, 2021 15:27
-
-
Save trnktms/186bc8ac72b7259e572f16b8ee11dc1b to your computer and use it in GitHub Desktop.
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
public class ChildrenBlock : ViewComponent | |
{ | |
private readonly IViewModelBinder _viewModelBinder; | |
public ChildrenBlock(IViewModelBinder viewModelBinder) | |
{ | |
_viewModelBinder = viewModelBinder; | |
} | |
public async Task<IViewComponentResult> InvokeAsync() | |
{ | |
return View( | |
"~/Views/Shared/Components/SitecoreComponent/ChildrenBlock.cshtml", | |
await _viewModelBinder.Bind<ChildrenBlockModel>(this.ViewContext)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment