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

fix(responsive): invalid initial value being returned #999

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

Xiaoy312
Copy link
Contributor

@Xiaoy312 Xiaoy312 commented Jan 12, 2024

GitHub Issue (If applicable): closes #998

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

ResponsiveExtension (binding) is returning the initial default value created by Activator.CreateInstance when the size is not available. This can cause a problem where the default value of said type is not a valid value, such as a the case for Grid.RowSpan.
User defined enums cannot be parsed.

What is the new behavior?

The initial default value returned will now be the first member defined within: Narrowest...Widest. The reasoning being that, if it is defined it has to be more valid than just the default(T).
User defined enums can now be parsed by ResponsiveExtension correctly.

PR Checklist

Please check if your PR fulfills the following requirements:

@Xiaoy312 Xiaoy312 requested a review from kazo0 January 12, 2024 15:50
@kazo0 kazo0 enabled auto-merge (squash) January 12, 2024 15:54
@kazo0 kazo0 merged commit 1fb3feb into main Jan 12, 2024
26 checks passed
@kazo0 kazo0 deleted the dev/xygu/20240112/responsive-binding-default-value branch January 12, 2024 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Responsive] binding throws when used on Grid.RowSpan
2 participants