Popularity
1.4
Growing
Activity
5.3
-
21
2
2

Programming language: C#
Tags: Mvvm    
Latest version: v5.2.3

Smaragd alternatives and similar packages

Based on the "MVVM" category

  • knockout

    Knockout makes it easier to create rich, responsive UIs with JavaScript
  • ReactiveUI

    An MVVM framework for .NET that integrates the Reactive Extensions (Rx) framework, enabling developers to build elegant, testable applications using WPF, Windows Store Apps, WP8 or Xamarin.
  • Prism

    A cross-platform desktop and mobile MVVM development framework.
  • MVVMCross

    Cross-platform mvvm mobile development framework for WPF, Silverlight for WP7 and WP8, Mono for Android, MonoTouch for iOS, Windows Universal projects (WPA8.1 and Windows 8.1 Store apps). Makes extensive use of Portable Class Libraries (PCL) to provide maintainable cross platform C# native applications.
  • 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.
  • Gemini

    IDE framework similar in concept to the Visual Studio Shell. Built on WPF, AvalonDock, and Caliburn Micro.
  • FreshMvvm

    FreshMvvm is a super light Mvvm Framework designed specifically for Xamarin.Forms. It's designed to be Easy, Simple and Flexible.
  • WPF Application Framework (WAF)

    A lightweight Framework that helps you to create well structured WPF Applications. It supports you in applying a Layered Architecture and the Model-View-ViewModel pattern.
  • Catel

    Catel is an application development platform with the focus on MVVM (WPF, Silverlight, Windows Phone and WinRT) and MVC (ASP.NET MVC). The core of Catel contains an IoC container, models, validation, memento, message mediator, argument checking, etc.
  • Stylet

    Minimal MVVM framework inspired by Caliburn Micro, with good documentation, high test coverage, and its own IoC container
  • DotNetProjects.WpfToolkit

    wpf toolkit fork of the MS WPF Toolkit (https://wpf.codeplex.com/releases/view/40535)
  • MVVM Dialogs

    Framework simplifying the concept of opening dialogs from a view model when using MVVM in WPF or UWP.
  • Toms Toolbox

    Visual Composition framework to easily build modularized MVVM applications based on the Managed Extensibility Framework (MEF).
  • Okra App Framework

    An app centric MVVM framework for Windows 8.1 built with dependency injection in mind, including a full set of Visual Studio MVVM templates.
  • M.V.B.

    Model View Binder - A small and robust framework for awesome cross platform architectures
  • MVVM Light Toolkit

    The main purpose of the toolkit is to accelerate the creation and development of MVVM applications in WPF, Silverlight, Windows Store (RT) and for Windows Phone
  • 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.

Do you think we are missing an alternative of Smaragd or a related project?

Add another 'MVVM' Package

README

[Smaragd](./resources/logo-x32.png)

CI Status NuGet version

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:

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.

  1. 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 of INotifyPropertyChanged and INotifyPropertyChanging

    class AppViewModel : ViewModel
    {
        // ...
    }
    
  1. 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);
            }
    }
    
  2. Make the property dependent on the ViewModel's IsDirty property. IsDirty indicates whether property values have changed. The Name property then automatically updates observing views when IsDirty changes.

    class AppViewModel : ViewModel
    {
            private string _name;
    
            [PropertySource(nameof(IsDirty))]
            public string Name
            {
                get => IsDirty ? $"{_name} (unsaved changes)" : _name;
                set => SetProperty(ref _name, value);
            }
    }
    
  3. 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;
        }
    }
    
  4. 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.