-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Support controlling render modes and RendererInfo during testing #1596
base: main
Are you sure you want to change the base?
Conversation
7a4dd4a
to
62c724c
Compare
b5c8029
to
e835c6c
Compare
@linkdotnet force pushed some changes! I think this is done, but there may be some improvements to the code before we merge in. |
Just tagging @scottsauber and @linkdotnet to see if you have suggestions to improve the code. Did some changes after the stream. Still missing a documentation page. |
/// Gets or sets the <see cref="IComponentRenderMode"/> that will be specified in | ||
/// the render tree for component the parameters are being passed to. | ||
/// </summary> | ||
public IComponentRenderMode? RenderMode { get; set; } |
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.
This and the ToRenderFragment
method should probably have been on the builder, but that we can move in V2, where the types are internal.
/// </summary> | ||
/// <param name="renderMode">The render mode to assign to the component, e.g. <c>RenderMode.InteractiveServer</c>, or <see langword="null"/>, to not assign a specific render mode.</param> | ||
/// <returns>This <see cref="ComponentParameterCollectionBuilder{TComponent}"/>.</returns> | ||
public ComponentParameterCollectionBuilder<TComponent> SetAssignedRenderMode(IComponentRenderMode? renderMode) |
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.
Set
still seems like the right name. Matches the SetRendererInfo
on Renderer.
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.
Okay, yeah see comment above
@@ -104,6 +112,9 @@ void AddComponent(RenderTreeBuilder builder) | |||
{ | |||
builder.OpenComponent<TComponent>(0); | |||
AddAttributes(builder); | |||
#if NET9_0_OR_GREATER |
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.
SetRenderMode would be better as this doesn’t have collection like behavior
.net 9 related changes
@rendermode
on elementtop level @rendermode