- KeldorKatarn
- Posts: 193
- Joined:
Getting UniRx ReactiveProperty and ReactiveCommand to work with Noesis databinding
This is more of a FYI.
I have created an issue in UniRx's GitHub: https://github.com/neuecc/UniRx/issues/489
Like the common ReactiveUI for WPF, the also have a version of ReactiveProperty and ReactiveCommand which are based on the Observable async pattern.
Unfortunately unlike the ReactiveUI implementation, theirs doesn not implement the INotifyPropertyChanged and ICommand interfaces.
Now naturally in Unity those are not really needed, however I suggested they implement them, like the ReactiveUI framework does. Once they do that, Noesis should be able
to use those types in viewmodels and we could databind directly against them. That's a very useful thing to have I think.
UniRx shows how useful the stream subscription approach to data is in Unity, since data and events can rapidly come in considering the high framerate of a game and the a UI reacting to those streams can be more adequate that the classic event driven approach.
If I have the time I might write the pull request for it myself. if anybody else gets to it quicker than I, feel free to.
I think this would massively benefit Noesis since UniRx is widely used by Unity developers I think. (I'm also using their UniRx.async extension to replace the standard Task class with an allocation free and PlayerLoop adjusted UniTask implementation that works great for the Caliburn-like framework I'm working on. Stuff like causing propertychanged notifications to happen only on the UI thread is as simple as:
await UniTask.WaitForMainThread(); // This is actually used INSIDE the Notify method.
NotifyPropertyChangedAsync('PropertyName');
I have created an issue in UniRx's GitHub: https://github.com/neuecc/UniRx/issues/489
Like the common ReactiveUI for WPF, the also have a version of ReactiveProperty and ReactiveCommand which are based on the Observable async pattern.
Unfortunately unlike the ReactiveUI implementation, theirs doesn not implement the INotifyPropertyChanged and ICommand interfaces.
Now naturally in Unity those are not really needed, however I suggested they implement them, like the ReactiveUI framework does. Once they do that, Noesis should be able
to use those types in viewmodels and we could databind directly against them. That's a very useful thing to have I think.
UniRx shows how useful the stream subscription approach to data is in Unity, since data and events can rapidly come in considering the high framerate of a game and the a UI reacting to those streams can be more adequate that the classic event driven approach.
If I have the time I might write the pull request for it myself. if anybody else gets to it quicker than I, feel free to.
I think this would massively benefit Noesis since UniRx is widely used by Unity developers I think. (I'm also using their UniRx.async extension to replace the standard Task class with an allocation free and PlayerLoop adjusted UniTask implementation that works great for the Caliburn-like framework I'm working on. Stuff like causing propertychanged notifications to happen only on the UI thread is as simple as:
await UniTask.WaitForMainThread(); // This is actually used INSIDE the Notify method.
NotifyPropertyChangedAsync('PropertyName');
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Getting UniRx ReactiveProperty and ReactiveCommand to work with Noesis databinding
I'm sure this would be very useful for many users. I hope UniRx developers consider your suggestion.
Thanks.
Thanks.
Re: Getting UniRx ReactiveProperty and ReactiveCommand to work with Noesis databinding
Once this is solved, we should list this extension with the rest of integrations developed by third parties.
Who is online
Users browsing this forum: Bing [Bot] and 18 guests