MSB.Mvvm 2.0.1

dotnet add package MSB.Mvvm --version 2.0.1
                    
NuGet\Install-Package MSB.Mvvm -Version 2.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MSB.Mvvm" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MSB.Mvvm" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="MSB.Mvvm" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MSB.Mvvm --version 2.0.1
                    
#r "nuget: MSB.Mvvm, 2.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MSB.Mvvm@2.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MSB.Mvvm&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=MSB.Mvvm&version=2.0.1
                    
Install as a Cake Tool

MSB.Mvvm (NET Standard)

Description

The MVVM Package is a NuGet package that provides a set of classes and utilities for implementing the Model-View-ViewModel architectural pattern in your .NET applications. The MVVM pattern helps separate concerns and provides a clear separation between the user interface (View), business logic (ViewModel), and data (Model).

Features

ViewModelBase

  • The ViewModelBase class is an abstract base class that implements the INotifyPropertyChanged interface and provides common functionality for ViewModel classes. It includes methods for raising property change notifications and managing property values.

RelayCommand

  • The RelayCommand class is an implementation of the ICommand interface that allows binding commands to methods in the ViewModel. It provides a way to encapsulate and execute parameterless commands.

RelayCommand<T>

  • The RelayCommand<T> class is a generic version of the RelayCommand class that allows binding commands to methods in the ViewModel with a single parameter of type T.

RelayCommandAsync

  • The RelayCommandAsync class is an asynchronous version of the RelayCommand class. It allows binding commands to asynchronous methods in the ViewModel.

RelayCommandAsync<T>

  • The RelayCommandAsync<T> class is a generic version of the RelayCommandAsync class that allows binding commands to asynchronous methods in the ViewModel with a single parameter of type T.

Installation

To install the library simply download it from NuGet and add the reference to your project.
Below we give you several options to install it using your preferred package manager.

  • .NET CLI
> dotnet add package MSB.Mvvm --version 2.X.X
  • Package Manager
PM> Install-Package MSB.Mvvm -Version 2.X.X
  • PackageReference
<PackageReference Include="MSB.Mvvm" Version="2.X.X" />
  • Paket CLI
> paket add MSB.Mvvm --version 2.X.X
  • Script & Interactive
> #r "nuget: MSB.Mvvm, 2.X.X"
  • Cake
// Install MSB.Mvvm as a Cake Addin
#addin nuget:?package=MSB.Mvvm&version=2.X.X

// Install MSB.Mvvm as a Cake Tool
#tool nuget:?package=MSB.Mvvm&version=2.X.X

Usage

To use the MVVM Package in your project, follow these steps:

  1. Install the MVVM Package from NuGet using the command mentioned above.
  2. Create your ViewModel classes by inheriting from the ViewModelBase class.
  3. Implement your commands using the RelayCommand or RelayCommandAsync classes.
  4. Bind your commands to UI elements in your View.
  5. Enjoy the benefits of the MVVM pattern in your application!

Example

Here's an example of a simple ViewModel that uses the MVVM Package:

using System.Windows.Input;
using MSB.Mvvm.Input;
using MSB.Mvvm;

public class MyViewModel : ViewModelBase
{
    public MyViewModel()
    {
        ShowMessageCommand = new RelayCommand(ShowMessage);
    }

    public string Message
    {
        get => _message;
        set => SetValue(ref _message, value);
    }

    public ICommand ShowMessageCommand
    {
        get;
    }

    private void ShowMessage()
    {
        Message = "Hello, MVVM!";
    }

    private string _message;
}

License

Feel free to modify the content according to your package's features and specifications.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 150 9/18/2024
2.0.0 136 9/10/2024
1.3.0 153 7/20/2024
1.2.0 281 12/22/2023 1.2.0 is deprecated because it has critical bugs.
1.1.2 230 7/12/2023
1.1.0 241 7/2/2023
1.0.0 303 1/25/2023