-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix: Allow IReactiveObject to access subscription extensions #2774
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: Allow IReactiveObject to access subscription extensions #2774
Conversation
- this change enables consumers to implement IReactiveObject and get PropertyChanged and PropertyChanging notifications (which regressed in version 11.4.1) - to get the notifications, one must call this.SubscribePropertyChangedEvents() or this.SubscribePropertyChangingEvents() on the IReactiveObject instance - related: reactiveui#2594
- there were unit tests failing because they compared string representations of double in the CultureInfo.InvariantCulture format. This was changed to CultureInfo.CurrentCulture to work with the culture of the Device running the tests
| var disp1 = fixture.Bind(vm, view, x => x.JustADecimal, x => x.SomeTextBox.Text, (IObservable<Unit>?)null, null); | ||
|
|
||
| Assert.Equal(vm.JustADecimal.ToString(CultureInfo.InvariantCulture), view.SomeTextBox.Text); | ||
| Assert.Equal(vm.JustADecimal.ToString(CultureInfo.CurrentCulture), view.SomeTextBox.Text); |
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.
These tests were failing on my machine, because here in Austria we have comma "," as decimal separator. I suppose this now runs on every machine, but I'll revert it if breaks something
| } | ||
|
|
||
| Assert.Equal(approvedPublicApi, receivedPublicApi); | ||
| Assert.Equal(approvedPublicApi.Trim(), receivedPublicApi); |
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.
I don't know why my VS keeps adding a blank line at the end of the approval files when saving, but with this the tests are green.
|
Thanks for the PR, I will do a release in the next day or so. |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
Custom implementation of
IReactiveObjectdoes not fire PropertyChanging and PropertyChanged events.See #2594
What is the new behavior?
IReactiveObjectExtensions.SubscribePropertyChangedEventsandIReactiveObjectExtensions.SubscribePropertyChangingEvents arenow publicWhat might this PR break?
This PR breaks the public API by adding two new public extension methods
IReactiveObjectExtensions.SubscribePropertyChangedEventsandIReactiveObjectExtensions.SubscribePropertyChangingEvents arePlease check if the PR fulfills these requirements
Other information: