-
Notifications
You must be signed in to change notification settings - Fork 0
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
How to get ChildContent to work in Blazor?? #74
Comments
In blazor a customer is trying to do the following: (If there is a solution already available please assist). I want to change the child of a docking element during the execution. Example:
I need an option to add content on the fly. |
@mddifilippo89 , in Web Components you can modify the layout object of the Dock Manager and then update like this - Update Layout. I'm not sure how this can be done in Blazor, so maybe @gmurray81 can answer this. |
@gmurray81 |
It would be more usual to make the pabe children conditional in the razor like you would do with Angular. But if doing it this way. The easiest method it jus to interleave markup when specifying the child content like ChildContent =@( ... )
Something along those lines. The sort of thing you'd do in react. Like I explained when this question came up in scrum. |
GitHub mangled that a bit... ChildContent = @(<div>...</div>) |
You can also specify a render fragment as a function, you you kind of need to know what you are doing. I'm not sure if MS has some good doc on it |
Ah in the above. I think you still want it to be a function that takes the context and returns the markup so that it has the data context. IIRC an arrow function will do. If you Google it, you should see, if not I can find an example somewhere. This isn't anything custom from us. It's standard Blazor stuff. |
See the answers to this guy: https://stackoverflow.com/questions/73301295/how-to-render-html-renderfragment-code-in-blazor |
private RenderFragment childContent { get; set; }
updating-panes.zip
The text was updated successfully, but these errors were encountered: