Fixed issue in TypedBinding not being able to support nullable types properly#381
Merged
TheCodeTraveler merged 8 commits intoCommunityToolkit:mainfrom Apr 11, 2025
Merged
Conversation
6 tasks
TheCodeTraveler
approved these changes
Apr 11, 2025
Collaborator
There was a problem hiding this comment.
Thanks @jBijsterboschNL!!
Just FYI - I updated the generic constraints to better implement this feature without using the Null Forgiving Operator (!).
This is modifies the API which is technically a breaking change, albeit, it should be a small impact with a relatively quick fix:
For example, this:
setter: static (vm, text) => vm.Text = textbecomes
setter: static (vm, text) => vm.Text = text ?? string.Empty
Contributor
Author
|
@TheCodeTraveler at first I didn't want to make it a breaking change (had the same idea), but good call to do it like this! Thanks for the quick follow up and merging this thing. Any idea on when this could be released, are there any plans for a new release yet? Thanks in advance! |
This was referenced Apr 27, 2026
Closed
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
When using the TypedBinding with a nullable type, an InvalidOperationException("Unable to find target value") was throw incorrectly/unnecessary.
Linked Issues
PR Checklist
approved(bug) orChampioned(feature/proposal)mainat time of PRAdditional information
Nullable types are now properly supported.