Smaragd alternatives and similar packages
Based on the "MVVM" category.
Alternatively, view Smaragd alternatives based on common mentions on social networks and blogs.
-
Prism
Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Xamarin Forms, and Uno / Win UI Applications.. -
ReactiveUI
An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application. -
MVVMCross
The .NET MVVM framework for cross-platform solutions, including Android, iOS, MacCatalyst, macOS, tvOS, WPF, WinUI -
Caliburn.Micro
A small, yet powerful framework, designed for building applications across all XAML platforms. Its strong support for MV* patterns will enable you to build your solution quickly, without the need to sacrifice code quality or testability. -
MVVM Light Toolkit
DISCONTINUED. The main purpose of the toolkit is to accelerate the creation and development of MVVM applications in Xamarin.Android, Xamarin.iOS, Xamarin.Forms, Windows 10 UWP, Windows Presentation Foundation (WPF), Silverlight, Windows Phone. -
Gemini
Gemini is an IDE framework similar in concept to the Visual Studio Shell. It uses AvalonDock and has an MVVM architecture based on Caliburn Micro. -
Stylet
A very lightweight but powerful ViewModel-First MVVM framework for WPF for .NET Framework and .NET Core, inspired by Caliburn.Micro. -
WPF Application Framework (WAF)
Win Application Framework (WAF) is a lightweight Framework that helps you to create well structured XAML Applications. -
FreshMvvm
FreshMvvm is a super light Mvvm Framework designed specifically for Xamarin.Forms. It's designed to be Easy, Simple and Flexible. -
MVVM Dialogs
Library simplifying the concept of opening dialogs from a view model when using MVVM in WPF -
DotNetProjects.WpfToolkit
wpf toolkit fork of the MS WPF Toolkit (https://wpf.codeplex.com/releases/view/40535) -
Web-Atoms Core
Light weight feature rich UI Framework for JavaScript for Browser with Dependency Injection, Mocking and Unit Testing -
Okra App Framework
DISCONTINUED. An app centric MVVM framework for Windows 8.1 built with dependency injection in mind, including a full set of Visual Studio MVVM templates. -
MvvmMicro
A clean and lightweight MVVM framework for WPF, UWP and .NET Standard 2.0 inspired by MVVM Light Toolkit. -
UpdateControls
Update Controls does not require that you implement INotifyPropertyChanged or declare a DependencyProperty. It connects controls directly to CLR properties. This makes it perfect for the Model/View/ViewModel pattern.
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Smaragd or a related project?
README
[Smaragd](./resources/logo-x32.png)
This is a very lightweight library containing base classes for implementing .NET applications using the MVVM architecture. It is fully unit tested and platform independent.
Features
Smaragd offers base implementations of key .NET interfaces for building WPF / MVVM applications.
[Core class diagram](./resources/diagram.png)
In addition, it enables developers to:
- Build dialog and tree structures via
DialogModel
andTreeViewModel
- Execute commands synchronously and asynchronously via
ViewModelCommand
andAsyncViewModelCommand
- Perform validation via
FuncValidation
andPredicateValidation
- Manage state updates for interdependent properties via
PropertySourceAttribute
For more information, please visit the documentation.
Installation
The recommended way to use this library is via NuGet.
Currently supported frameworks:
- .NET Standard 2.0 or higher
- .NET Framework 4.5 or higher
Quick Start
The following is a simple demonstration of some core features of Smaragd.
- Choose a base class for your ViewModel.
- Inherit from
ViewModel
if you want to use the fill feature set (recommended) Inherit from
Bindable
if you only want an implementation ofINotifyPropertyChanged
andINotifyPropertyChanging
class AppViewModel : ViewModel { // ... }
Add a property with a backing field that invokes
PropertyChanged
when set.class AppViewModel : ViewModel { private string _name; public string Name { get => _name; set => SetProperty(ref _name, value); } }
Make the property dependent on the
ViewModel
'sIsDirty
property.IsDirty
indicates whether property values have changed. TheName
property then automatically updates observing views whenIsDirty
changes.class AppViewModel : ViewModel { private string _name; [PropertySource(nameof(IsDirty))] public string Name { get => IsDirty ? $"{_name} (unsaved changes)" : _name; set => SetProperty(ref _name, value); } }
Add an async command to reset the
IsDirty
flag.class AppViewModel : ViewModel { private string _name; [PropertySource(nameof(IsDirty))] public string Name { get => IsDirty ? $"{_name} (unsaved changes)" : _name; set => SetProperty(ref _name, value); } private IViewModelCommand<AppViewModel> _saveCommand; [IsDirtyIgnored] [IsReadOnlyIgnored] public IViewModelCommand<AppViewModel> SaveCommand => _saveCommand ??= new SaveCommand(this) } class SaveCommand : AsyncViewModelCommand<AppViewModel> { public SaveCommand(AppViewModel context) { Context = context; } protected override async Task ExecuteAsync(AppViewModel viewModel, object parameter) { // SaveChanges(viewModel); viewModel.IsDirty = false; } }
Create a view in XAML for your
ViewModel
and enjoy working with bindings.<Window Title="{Binding Name}"> <Button Command="{Binding SaveCommand}"> </Window>
In case you would like to see a more advanced reference application please don't hesitate to visit my other project Stein.
Why another MVVM library?
This library originated in my other project Stein and was subsequently moved to its own repository and nuget package. The goal is to provide a great yet minimal foundation which also promotes a good code style. Nearly everything is marked virtual (except events) so you can customize it to fit your needs.
And of course, this library is 🚀blazing fast🚀.
Contribution
If you find a bug feel free to open an issue. Contributions are also appreciated.