-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
TaskResultConverter returns default value when task not set #4790
TaskResultConverter returns default value when task not set #4790
Conversation
Thanks michael-hawker for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
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.
Couldn't find any issues with it, and checking around this seems to be the best approach. Approved!
0dcb6f0
to
9626250
Compare
@Sergio0694 had concerns on reflection bit for value type support. So instead updated the comment to reflect actual behavior (returning Part of the discrepancy/confusion here is also due to the fact the base methods we use have slightly different behavior between the generic and non-generic versions from the |
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.
Ship it!
Hello @michael-hawker! Because this pull request has the Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 6 hours 57 minutes. No worries though, I will be back when the time is right! 😉 p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
…fault value in case task is not set or has not completed. Updated description to include unset Task scenario (i.e. null being passed in) Updated to include proper default value return for Value types Included value passthru for non-Task values
Update description to explicitly call out returning null instead of default if no task or task result not ready.
9626250
to
e3fe539
Compare
Fixes #4505
Adds better testing around real-world
x:Bind
and converter scenarios forTaskResultConverter
, also related to the nature of how this interacts with the MVVM Toolkit behavior (which would mimic most real-world app behavior as well).Fixes the converter to better handle a wider variety of scenarios.
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The TaskResultConverter will return
UnsetValue
when the expectedTask
has not been initialized yet (and isnull
).The documentation specified the
default
value would be returned, but this was not true for value types.What is the new behavior?
TaskResultConverter
now will return the default value (null or otherwise for value types) whether a task is set or not.It'll also passthru non-task values as a no-op.
PR Checklist
Please check if your PR fulfills the following requirements:
Other information
See more details in accompanying issue.