-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: Fix android crashing on text binding #2390
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,10 +142,14 @@ private static DispatchItem CreateFromWidget<TView, TEventArgs>(Expression<Func< | |
| { | ||
| var view = (TView)x; | ||
|
|
||
| return Observable.FromEvent<EventHandler<TEventArgs>, TEventArgs>( | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was the cause of the error. The event handlers weren't being set properly.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Essentially, there was a mismatch between the EventHandler and Rx would cause an exception. Now we are explicitly specifying the event handler method which is more efficient since it avoids reflection anyway. |
||
| return Observable.FromEvent<EventHandler<TEventArgs>, ObservedChange<object, object>>( | ||
| eventHandler => | ||
| { | ||
| void Handler(object sender, TEventArgs e) => eventHandler(new ObservedChange<object, object>(view, ex)); | ||
| return Handler; | ||
| }, | ||
| h => addHandler(view, h), | ||
| h => removeHandler(view, h)) | ||
| .Select(_ => new ObservedChange<object, object>(view, ex)); | ||
| h => removeHandler(view, h)); | ||
| } | ||
| }; | ||
| } | ||
|
|
||
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.
This is just syntactic sugar to remove a Tuple instance for the more efficient ValueTuple.