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

Support Binding to IReactiveObject's #114

Merged
merged 3 commits into from
Oct 12, 2020
Merged

Support Binding to IReactiveObject's #114

merged 3 commits into from
Oct 12, 2020

Conversation

worldbeater
Copy link
Collaborator

@worldbeater worldbeater commented Oct 12, 2020

What kind of change does this PR introduce?

Currently, ReactiveUI.Validation doesn't support creating ValidationRules for objects that don't inherit from a ReactiveObject. Also, binding to IViewFor<IReactiveObject> via BindValidation isn't supported. However, there may be cases, when one needs to use an interface as a type parameter in IViewFor (e.g. IViewFor<IViewModel>). Also, some folks may decide to use a custom IReactiveObject implementation e.g. in case if they use ReactiveUI with MvvmCross, Prism, etc. So this PR changes the generic type constraint from : ReactiveObject to : class, IReactiveObject and adds a few tests for this.

What is the current behavior?

Currently, ReactiveUI.Validation doesn't support binding to IReactiveObjects.

What is the new behavior?

Now, ReactiveUI.Validation supports binding to IReactiveObjects.

What might this PR break?

Nothing.

@worldbeater worldbeater added the enhancement New feature or request label Oct 12, 2020
@worldbeater worldbeater requested a review from a team October 12, 2020 10:47
@codecov
Copy link

codecov bot commented Oct 12, 2020

Codecov Report

Merging #114 into main will increase coverage by 0.22%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
+ Coverage   52.51%   52.73%   +0.22%     
==========================================
  Files          16       16              
  Lines         895      895              
==========================================
+ Hits          470      472       +2     
+ Misses        425      423       -2     
Impacted Files Coverage Δ
Helpers/ReactiveValidationObject.cs 96.96% <0.00%> (+6.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c04c179...eb03918. Read the comment docs.

@worldbeater worldbeater merged commit f0040f9 into main Oct 12, 2020
@worldbeater worldbeater deleted the ireactiveobject branch October 12, 2020 11:15
@reactiveui reactiveui locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants