Class ComponentExtensions
- Namespace
- Dynamicweb.CoreUI.Rendering
- Assembly
- Dynamicweb.CoreUI.Rendering.dll
Extension methods for simplification of Dynamicweb component rendering
- Inheritance
-
Component
Extensions
- Inherited Members
Methods
EncodePath(IHtmlHelper, string?)
Parameters
html
IHtmlHelper value
string
Returns
EncodeUrl(IHtmlHelper, string?)
Parameters
html
IHtmlHelper url
string
Returns
GetUniqueId(IHtmlHelper, object?)
Parameters
_
IHtmlHelper model
object
Returns
Icon(IViewComponentHelper, Icon?, Dictionary<string, string>?, Size)
public static Task<IHtmlContent?> Icon(this IViewComponentHelper viewComponentHelper, Icon? icon, Dictionary<string, string>? attributes = null, Size size = Size.Small)
Parameters
viewComponentHelper
IViewComponent Helper icon
Iconattributes
Dictionary<string, string>size
Size
Returns
RenderComponentPartial<TModel>(IHtmlHelper, string, TModel)
public static Task<IHtmlContent?> RenderComponentPartial<TModel>(this IHtmlHelper html, string partialName, TModel model)
Parameters
html
IHtmlHelper partialName
stringmodel
TModel
Returns
Type Parameters
TModel
RenderComponentizedListOption(IHtmlHelper, ComponentizedListOption?)
public static Task<IHtmlContent?> RenderComponentizedListOption(this IHtmlHelper html, ListBase.ComponentizedListOption? option)
Parameters
html
IHtmlHelper option
ListBase .ComponentizedList Option
Returns
RenderDynamicwebScreenWrapper(IViewComponentHelper, ScreenTypeBase)
public static Task<IHtmlContent?> RenderDynamicwebScreenWrapper(this IViewComponentHelper viewComponentHelper, ScreenTypeBase screenType)
Parameters
viewComponentHelper
IViewComponent Helper screenType
ScreenType Base
Returns
RenderDynamicwebUiComponent(IViewComponentHelper, UiComponentBase?)
Renders the passed Dynamicweb UiComponent as a model in a view with the same name as the fully qualified name of the viewmodel.
public static Task<IHtmlContent?> RenderDynamicwebUiComponent(this IViewComponentHelper viewComponentHelper, UiComponentBase? viewModel)
Parameters
viewComponentHelper
IViewComponent Helper The viewcomponent helper of the view calling this extension. This is an extension method
viewModel
UiComponent Base An instance of a Ui
Component model to be renderedBase
Returns
- Task<IHtml
Content > A IHtml
Content response of the rendered model using the
Remarks
The view to render the model is located by convention. If the model is Text the view rendering the model is /Views/Shared/Components/UiComponentWrapper/Dynamicweb.CoreUI.Editors.Inputs.Text.cshtml
RenderDynamicwebUiComponent(IViewComponentHelper, UiComponentBase?, Dictionary<string, string>?)
public static Task<IHtmlContent?> RenderDynamicwebUiComponent(this IViewComponentHelper viewComponentHelper, UiComponentBase? viewModel, Dictionary<string, string>? attributes)
Parameters
viewComponentHelper
IViewComponent Helper viewModel
UiComponent Base attributes
Dictionary<string, string>
Returns
ToJson(IHtmlHelper, object?, bool)
public static IHtmlContent ToJson(this IHtmlHelper html, object? input, bool useApiSerializerOptions = false)
Parameters
html
IHtmlHelper input
objectuseApiSerializerOptions
bool