New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TemplateHost control #1109
TemplateHost control #1109
Conversation
Rewritten UI test to test usage in composite controls
|
||
|
||
protected internal override void OnLoad(IDotvvmRequestContext context) | ||
{ | ||
ContentTemplate?.BuildContent(context, this); | ||
var placeHolder = new PlaceHolder(); | ||
Template.BuildContent(context, placeHolder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nullable types should complain somewhere here, please add a simple nullcheck to avoid NRE when users forgets to set the property.
Template.BuildContent(context, placeHolder); | |
Template.NotNull("TemplateHost.Template is required").BuildContent(context, placeHolder); |
Also, I think it would be convenient to add a constructor overload with template as parameter. Maybe we could also add overload to the AppendChildren(ITemplate) helper method that would automatically create this control.
When working on #535, we found that it will be useful to have a
TemplateHost
control.I've put it in a separate PR and added some UI tests - the control can be used to pass templates in markup controls.