Replies: 8 comments 1 reply
-
In my most recent project, I have used both at the same time. The source generator from the MVVM toolkit to make observable properties is very concise and easy to read, but when it comes to responding to events and performing side effects, I really like using ReactiveUI with its You can pretty easily make a bridge between to the 2 libraries by using something like this as your view model base class public abstract class ReactiveObservableObject : ObservableObject, IReactiveObject
{
public void RaisePropertyChanging(PropertyChangingEventArgs args) => OnPropertyChanging(args);
public void RaisePropertyChanged(PropertyChangedEventArgs args) => OnPropertyChanged(args);
} So overall I don't think they really need to compete for a place in your application but can instead by used to compliment each other. |
Beta Was this translation helpful? Give feedback.
-
I personally use ReactiveUI. It works pretty well once you get the hang of its weirdness. Beyond that I have not had any issues using it with Avalonia, and that includes some of it's more advanced features such as Source caches. I can't say I have used Community MVVM though. But it's source generators do look pretty nice and probably also work better for AOT if you are going down that route. |
Beta Was this translation helpful? Give feedback.
-
Some good comments here: https://www.reddit.com/r/AvaloniaUI/comments/136cbvr/community_toolkit_or_reactiveui_for_beginner/ I think a lot of projects use Community Toolkit now for the source generators. ReactiveUI is also a steeper learning curve but can do a few more advanced things IMO. Community MVVM Toolkit does most of what you need and generally does it faster and simpler -- not to mention it is an official side-project of Microsoft. Also note that in Avalonia v11.0 itself, work was put into decoupling from ReactiveUI where possible. Though you'll still find subscriptions and observables in places like binding expressions (where they do not exist in WPF). Still, in the past it seems ReactiveUI was recommended with Avalonia and was/is used heavily within the project itself. |
Beta Was this translation helpful? Give feedback.
-
Thanks for all the replies guys. I don't intend to use them side by side, my ultimate goal is to deploy to a raspberry running on a custom SOM board, and the on chip non-volatile memory is at a premium. So I'd like to pick one or the other to keep the deployment size as small as possible. I've work a lot with Reactive Extensions and RXJS for Typescript, JavaScript and Node...how much different is the ReactiveUI from those? Same concepts and use model? When you talk about the MVVM source generators, I assume you mean when decorating properties, the automatic injection of the helper methods during compile time, for properties and such? |
Beta Was this translation helpful? Give feedback.
-
Then I'd pick the MVVM Toolkit:
See: https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/generators/overview |
Beta Was this translation helpful? Give feedback.
-
I prefer Mvvm Toolkit. I've found ReactiveUI to be too awkward in the learning curve and to be a viral philosophy where you're trying to make everything reactive. ReactiveUI does have a larger feature set, plus framework-specific implementations. Mvvm Toolkit is wholly portable and doesn't contain framework-specific bits like a dialog service, so you need to code that yourself or use a library like MvvmDialogs You don't need to use the sourcegen attributes if you don't want to. You can write code in the same way you do in other Mvvm Frameworks with full properties or commands that need to be instantiated. Sourcegen makes the experience a lot more succinct. If you do end up needing some reactivity in an Mvvm Toolkit app, you can pull in |
Beta Was this translation helpful? Give feedback.
-
I guess since this is a discussion, and not a question, I can't mark any answers, but the replies I've received are excellent, and I thank you guys. Keep an eye out for my next thread. :) |
Beta Was this translation helpful? Give feedback.
-
android.intent.ACTION_DECODE_DATA" trigger RelayCommand |
Beta Was this translation helpful? Give feedback.
-
Hey guys, this is probably going to turn into one of those religious discussions, but I'm looking for a little advice on plugin vs plugin for the AvaloniaUI framework.
I'm using Avalonia in a Desktop -> Raspberry PI scenario, so the ultimate destination is the Raspberry PI 4b. I don't think that matters, but maybe there's some drawbacks or advantages that I'm not aware of for hardware.
I'm a very experienced developer, and am no stranger to cutting edge frameworks and designs. I was one of the original Silverlight design / development team, SignalR team, and several others that are probably familiar to most. I say this because "easy" or "low learning curve" aren't really that important.
What I'm looking to figure out, is where the community heat map is. The examples for both the ReactiveUI and the MVVMKit are pretty old as far as the frameworks have progressed in the last 6 months. Which framework are people leaning towards as the adoptive default. I know ReactiveUI is the way the template comes out of the box for Mvvm, but it's only partially implemented and leaves the dev kind of hanging. The MVVMKit seems like a much easier approach to get started with Avalonia, but all reports are the MVVM toolkit is a LOT less flexible in terms of larger development projects. It also by default uses the Decorator pattern, which isn't my favorite, not sure if you can change it.
TLDR VERSION: Larger Project - good developer, need advice and reasoning behind why you'd choose MVVM Kit vs ReactiveUI
Thanks Guys.
Beta Was this translation helpful? Give feedback.
All reactions