Skip to content
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

Add support for binding to MarkupString values #47719

Closed
wants to merge 1 commit into from

Conversation

kzu
Copy link

@kzu kzu commented Apr 14, 2023

It's quite convenient to be able to bind directly to data containing raw HTML. This is quite convoluted to do today, requiring registering a TypeDescriptionProvider, which in turn returns a custom type descriptor which in turn can provide the missing TypeConverter for the desired type.

This adds support out of the box for binding straight to markup strings.

Follows the implementation and tests from #10730.

Closes #47718

Add support for binding to MarkupString values

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Summary of the changes (Less than 80 chars)

Description

See the associated feature/issue #47718.

@kzu kzu requested a review from a team as a code owner April 14, 2023 21:52
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Apr 14, 2023
@ghost ghost added area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member labels Apr 14, 2023
@ghost
Copy link

ghost commented Apr 14, 2023

Thanks for your PR, @kzu. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

It's quite convenient to be able to bind directly to data containing raw HTML. This is quite convoluted to do today, requiring registering a TypeDescriptionProvider, which in turn returns a custom type descriptor which in turn can provide the missing TypeConverter for the desired type.

This adds support out of the box for binding straight to markup strings.

Follows the implementation and tests from dotnet#10730.

Closes dotnet#47718
@MackinnonBuck
Copy link
Member

Thanks for your PR. We will be closing this out per the reasoning here: #47718 (comment)

@kzu kzu deleted the markup-string-converter branch April 17, 2023 20:51
@kzu
Copy link
Author

kzu commented Apr 17, 2023

Folks finding this: here's a way to achieve this https://www.cazzulino.com/blazor-markupstring.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for binding to MarkupString values
2 participants