NuExt.Minimal.Mvvm.SourceGenerator 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package NuExt.Minimal.Mvvm.SourceGenerator --version 0.2.0                
NuGet\Install-Package NuExt.Minimal.Mvvm.SourceGenerator -Version 0.2.0                
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="NuExt.Minimal.Mvvm.SourceGenerator" Version="0.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NuExt.Minimal.Mvvm.SourceGenerator --version 0.2.0                
#r "nuget: NuExt.Minimal.Mvvm.SourceGenerator, 0.2.0"                
#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.
// Install NuExt.Minimal.Mvvm.SourceGenerator as a Cake Addin
#addin nuget:?package=NuExt.Minimal.Mvvm.SourceGenerator&version=0.2.0

// Install NuExt.Minimal.Mvvm.SourceGenerator as a Cake Tool
#tool nuget:?package=NuExt.Minimal.Mvvm.SourceGenerator&version=0.2.0                

NuExt.Minimal.Mvvm.SourceGenerator

NuExt.Minimal.Mvvm.SourceGenerator is an extension for the lightweight MVVM framework NuExt.Minimal.Mvvm. This package includes a source generator that produces boilerplate code for your ViewModels at compile time, simplifying development and reducing routine work. By automating repetitive tasks, it helps you focus on implementing application-specific logic.

Features

  • Automatically generates boilerplate code for ViewModels.
  • Simplifies the development process by reducing repetitive coding tasks.
  • Seamlessly integrates with the NuExt.Minimal.Mvvm framework.
  • Enhances maintainability and readability of your codebase.

Installation

You can install NuExt.Minimal.Mvvm.SourceGenerator via NuGet:

dotnet add package NuExt.Minimal.Mvvm.SourceGenerator

Or through the Visual Studio package manager:

  1. Go to Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution....
  2. Search for NuExt.Minimal.Mvvm.SourceGenerator.
  3. Click "Install".

Dependencies

To use this source generator effectively, you need to have any of these packages installed in your project: NuExt.Minimal.Mvvm, NuExt.Minimal.Mvvm.Windows, or NuExt.Minimal.Mvvm.MahApps.Metro. You can add them via NuGet as well:

For the base MVVM framework:

dotnet add package NuExt.Minimal.Mvvm

For Windows-specific extensions:

dotnet add package NuExt.Minimal.Mvvm.Windows

For MahApps.Metro integration:

dotnet add package NuExt.Minimal.Mvvm.MahApps.Metro

Usage Examples

Example using auto-generated property notifications

Given a user class such as:

using Minimal.Mvvm;

public partial class MyModel : BindableBase
{
    [Notify]
    private string? _description;

    [Notify(Setter = AccessModifier.Private)]
    private string _name;
}

The generator could produce the following:

partial class MyModel
{
    public string Description
    {
        get => _description;
        set => SetProperty(ref _description, value);
    }

    public string Name
    {
        get => _name;
        private set => SetProperty(ref _name, value);
    }
}

This example demonstrates how the source generator automatically creates properties with notification changes for fields marked with the [Notify] attribute, thereby reducing boilerplate code.

Contributing

Contributions are welcome! Feel free to submit issues, fork the repository, and send pull requests. Your feedback and suggestions for improvement are highly appreciated.

License

Licensed under the MIT License. See the LICENSE file for details.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NuExt.Minimal.Mvvm.SourceGenerator:

Package Downloads
NuExt.Minimal.Mvvm.MahApps.Metro

Extensions for the MahApps.Metro toolkit using the Minimal MVVM Framework for streamlined Metro-style WPF app development. Commonly Used Types: Minimal.Mvvm.Windows.DialogCoordinatorService Minimal.Mvvm.Windows.MetroDialogService Minimal.Mvvm.Windows.MetroTabbedDocumentService MahApps.Metro.Controls.Dialogs.MetroDialog

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.3 73 11/20/2024
0.2.2 69 11/17/2024
0.2.0 69 11/15/2024
0.1.0 79 11/11/2024