Replies: 1 comment 2 replies
-
I'm not really clear on why this is an improvement? Especially with the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I feel that regular .NET event handlers could be awkward to work with, so what about using
IObservable<T>
instead?I changed some code in my fork of Pinta in order to test this out, and it appears to be feasible. However, given the amount of work needed for this, I would like to discuss it first in order to know the way forward.
Take, for example,
LayerManager
. It has the following events:...Along with the code that triggers them:
What if we started using
IObservable<T>
instead? We could know which events are available for listening by 'reading them off' the list of interfaces:It would work in the following way:
This looks more verbose, but I could encapsulate this mechanism in some sort of
EventTerminal
class, or we could use something like Rx.NET, and the code wouldn't be that much larger if it's done right.Beta Was this translation helpful? Give feedback.
All reactions