/// <inheritdoc /> public override async Task ProcessWhileAwareOfModelTypeAsync <TModel>(TagHelperContext context, TagHelperOutput output) { var helper = ViewContext.GetHtmlHelper <TModel>(); var leadingHtml = LeadingHtml?.Invoke(null) ?? LeadingHtmlContent; var heading = Heading != null?Heading.ToHtml() : (HeadingHtml?.Invoke(null) ?? HeadingHtmlContent); if (helper.IsInChameleonFormsSection()) { var s = helper.GetChameleonFormsSection(); using (s.BeginSection(heading: heading, leadingHtml: leadingHtml, context.GetHtmlAttributes())) { var childContent = await output.GetChildContentAsync(); childContent.WriteTo(helper.ViewContext.Writer, HtmlEncoder.Default); } } else { var f = helper.GetChameleonForm(); using (f.BeginSection(heading: heading, leadingHtml: leadingHtml, context.GetHtmlAttributes())) { var childContent = await output.GetChildContentAsync(); childContent.WriteTo(helper.ViewContext.Writer, HtmlEncoder.Default); } } output.SuppressOutput(); }
/// <inheritdoc /> public override async Task ProcessWhileAwareOfModelTypeAsync <TModel>(TagHelperContext context, TagHelperOutput output) { var helper = ViewContext.GetHtmlHelper <TModel>(); var heading = Heading != null?Heading.ToHtml() : (HeadingHtml?.Invoke(null) ?? HeadingHtmlContent); var f = helper.GetChameleonForm(); using (f.BeginMessage(heading: heading, messageType: Type)) { var childContent = await output.GetChildContentAsync(); childContent.WriteTo(helper.ViewContext.Writer, HtmlEncoder.Default); } output.SuppressOutput(); }