Rhizine.DialogGenerator 1.0.7

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Rhizine.DialogGenerator --version 1.0.7
                    
NuGet\Install-Package Rhizine.DialogGenerator -Version 1.0.7
                    
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="Rhizine.DialogGenerator" Version="1.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rhizine.DialogGenerator" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="Rhizine.DialogGenerator" />
                    
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 Rhizine.DialogGenerator --version 1.0.7
                    
#r "nuget: Rhizine.DialogGenerator, 1.0.7"
                    
#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 Rhizine.DialogGenerator@1.0.7
                    
#: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=Rhizine.DialogGenerator&version=1.0.7
                    
Install as a Cake Addin
#tool nuget:?package=Rhizine.DialogGenerator&version=1.0.7
                    
Install as a Cake Tool

DialogGenerator NuGet Version

DialogGenerator is a source generator and attribute that simplifies the process of creating dialog popups for ICommand results.

Features

  • Easy-to-use attribute-based dialog generation
  • Support for multiple dialog types (Bubble, Toast, Modal, Snackbar)
  • Customizable success and failure messages
  • Options for dialog duration, position, and theme
  • Compile-time generation for improved performance

Usage

  1. Add the necessary using statement in your ViewModel:
using DialogAttributes;
  1. Decorate your command properties with the ShowDialogResult attribute:
public class MainViewModel : ViewModelBase
{
    [ShowDialogResult(Type = DialogType.Toast, SuccessMessage = "Save successful!", FailureMessage = "Save failed", Duration = 3000, Position = "TopRight", Theme = "Dark")]
    public ICommand SaveCommand => new RelayCommand(SaveData);

    [ShowDialogResult(Type = DialogType.Modal, SuccessMessage = "Item deleted", FailureMessage = "Delete operation failed")]
    public ICommand DeleteCommand => new RelayCommand(DeleteItem);

    private bool SaveData()
    {
        // Your save logic here
        return true; // or false if the operation failed
    }

    private bool DeleteItem()
    {
        // Your delete logic here
        return true; // or false if the operation failed
    }
}

The source generator will automatically create decorated versions of your commands that show the appropriate dialog based on the command's result.

Attribute Options

The ShowDialogResult attribute accepts the following parameters:

  • Type: The type of dialog to show (Bubble, Toast, Modal, Snackbar)
  • SuccessMessage: The message to display when the command succeeds
  • FailureMessage: The message to display when the command fails
  • Duration: The duration (in milliseconds) for which the dialog should be displayed (for non-modal dialogs)
  • Position: The position of the dialog (e.g., "TopRight", "Center", "BottomLeft")
  • Theme: The theme of the dialog (e.g., "Light", "Dark")

The full list of types is defined by this enumeration:

public enum DialogType
{
    Bubble,
    Toast,
    Modal,
    MessageBox,
    Input,
    Confirmation,
    YesNo,
    OpenFile,
    SaveFile,
    OpenFolder,
    Snackbar
}

Notes

Ensure that your project is using C# 8.0 or later. The generated code assumes the existence of an IDialogService in your application. Implement this interface to handle the actual display of dialogs.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.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