Exemplo n.º 1
0
 /// <summary>
 /// Creates a template component parameter which will pass the a <see cref="Microsoft.AspNetCore.Components.RenderFragment{TValue}" />
 /// to the parameter with the name <paramref name="name"/>.
 /// The <paramref name="markupFactory"/> will be used to generate the markup inside the template.
 /// </summary>
 /// <typeparam name="TValue">The value used to build the content.</typeparam>
 /// <param name="name">Parameter name.</param>
 /// <param name="markupFactory">A markup factory that takes a <typeparamref name="TValue"/> as input and returns markup/HTML.</param>
 /// <returns>The <see cref="ComponentParameter"/>.</returns>
 protected static ComponentParameter Template <TValue>(string name, Func <TValue, string> markupFactory)
 => ComponentParameterFactory.Template <TValue>(name, markupFactory);
Exemplo n.º 2
0
 /// <summary>
 /// Creates a template component parameter which will pass the <paramref name="template"/> <see cref="Microsoft.AspNetCore.Components.RenderFragment{TValue}" />
 /// to the parameter with the name <paramref name="name"/>.
 /// </summary>
 /// <typeparam name="TValue">The value used to build the content.</typeparam>
 /// <param name="name">Parameter name.</param>
 /// <param name="template"><see cref="Microsoft.AspNetCore.Components.RenderFragment{TValue}" /> to pass to the parameter.</param>
 /// <returns>The <see cref="ComponentParameter"/>.</returns>
 protected static ComponentParameter Template <TValue>(string name, RenderFragment <TValue> template)
 => ComponentParameterFactory.Template <TValue>(name, template);