CustomControls.MAUI.MessageBox 1.0.0

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

// Install CustomControls.MAUI.MessageBox as a Cake Tool
#tool nuget:?package=CustomControls.MAUI.MessageBox&version=1.0.0

A message box in MAUI, often referred to as a dialog box or alert box, is a user interface element in software applications used to display information, prompt the user for input, or provide notifications. It serves specific functions and has distinct requirements to enhance user interaction. Here's an overview of the functions and requirements of a message box:

Functions:

  1. Informational Messages:

    • Purpose: Display important information or notifications to the user.
    • Importance: Users need to be informed about critical events, updates, or changes in the application.
  2. User Input Prompt:

    • Purpose: Request input or decision from the user through buttons or text fields.
    • Importance: Message boxes can be used to gather user input for various scenarios such as confirmation, data entry, or configuration settings.
  3. Error Handling:

    • Purpose: Communicate error messages to users when an unexpected or erroneous situation occurs.
    • Importance: Informing users about errors helps them understand issues and take appropriate actions to resolve or report problems.
  4. Warning Messages:

    • Purpose: Alert users about potential issues or actions that may have consequences.
    • Importance: Warn users to prevent accidental actions or inform them of potential risks associated with their choices.
  5. Confirmation Dialogs:

    • Purpose: Confirm user intent before performing critical actions (e.g., deleting a file).
    • Importance: Reduces the likelihood of accidental or irreversible actions, ensuring that users are aware of the consequences.
  6. Progress Indication:

    • Purpose: Display progress information during time-consuming operations.
    • Importance: Keeps users informed about ongoing processes, preventing confusion about whether the application is still responsive.

Requirements:

  1. Clarity and Readability:

    • Requirement: Message box content should be clear, concise, and easy to read.
    • Importance: Users should quickly understand the information or action requested without confusion.
  2. Consistent Design:

    • Requirement: Maintain a consistent design and style with the overall application.
    • Importance: Consistency fosters a predictable user experience and helps users recognize and understand the purpose of the message box.
  3. Configurability:

    • Requirement: Allow customization of message box appearance and behavior.
    • Importance: Different scenarios may require variations in the design or functionality of the message box.
  4. Accessibility:

    • Requirement: Ensure accessibility for users with disabilities.
    • Importance: Message boxes should be designed to accommodate users who rely on assistive technologies.
  5. User Interaction Handling:

    • Requirement: Implement clear and intuitive ways for users to interact with the message box (e.g., buttons for confirmation or dismissal).
    • Importance: User interactions should be straightforward, reducing the risk of user errors or confusion.
  6. Responsiveness:

    • Requirement: Ensure that message boxes appear promptly and do not hinder the responsiveness of the application.
    • Importance: Users should not experience delays or disruptions in their workflow due to the display of message boxes.
  7. Localization:

    • Requirement: Support localization for messages to cater to a diverse user base.
    • Importance: Ensure that messages are presented in the user's preferred language, enhancing global usability.

By fulfilling these functions and requirements, message boxes contribute to a positive user experience by providing essential information, guiding user actions, and maintaining clarity in communication between the user and the application.

Here are the steps to use this project:

  1. Tutorial video link :"https://youtu.be/8AIRRIbEb_E"

  2. Installation:

    • Install the NuGet package
  3. Registering CommunityToolkit.Maui in MauiProgram

using CommunityToolkit.Maui;

using CustomControls.MAUI.MessageBox;

using CustomControls.MAUI.MessageBox.AppPresentations.CommonSource;

using CustomControls.MAUI.MessageBox.AppPresentations.Utilities;

namespace MauiAppCustomPopupSample;

public static class MauiProgram { [Obsolete]

public static MauiApp CreateMauiApp()
{

    try
    {
	
        //Initial setup for MAUI messagebox[Application Level declaration]
		
        ModalMessageBoxConfigurationSetup.SetupModalMessageBox(
		
          customMessageBoxTextColor: Color.FromArgb("#FFFFFF"),
		  
          customMessageBoxHeightRequest: 350,
		  
          customMessageBoxWidthRequest: 300,
		  
          customMessageBoxBackgroundColor: Color.FromArgb("#000000"),
		  
          customMessageBoxTitlePosition: LayoutOptions.CenterAndExpand,
		  
          customMessageBoxButtonBackgroundColor: Color.FromArgb("#FFFFFF"),
		  
          CustomMessageBoxButtonTextColor: Color.FromArgb("#000000")
		  
          );
		  
        var builder = MauiApp.CreateBuilder();
		
        builder.UseMauiApp<App>().ConfigureFonts(fonts =>
        {
		
            fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
			
            fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
			
        });
		
        RegisterEssentials(builder.Services);
		
        RegisterPages(builder.Services);
		
        RegisterViewModels(builder.Services);
		
        builder.UseMauiCommunityToolkit();//Registering for MAUI Popup
		
        var app = builder.Build();
		
        MauiServiceHandler.MauiAppBuilder = app;
		
        return app;
		
    }
    catch (Exception ex)
    {

        return null;
    }
}

static void RegisterPages(in IServiceCollection services)
{

    services.AddTransient<MainPage>();
	
}

static void RegisterViewModels(in IServiceCollection services)
{

    services.AddTransient<MainPageViewModel>();
	
    services.AddTransient<MyCustomPopupViewModel>();
	
}

static void RegisterEssentials(in IServiceCollection services)
{

    services.AddSingleton<IModalMessageBoxServiceHandler, ModalMessageBoxServiceHandler>();
	
}

}

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-android31.0 is compatible.  net6.0-ios was computed.  net6.0-ios16.1 is compatible.  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. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

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
1.1.0 84 2/10/2024
1.0.0 217 11/19/2023

This package incorporates built-in features for a Simple Alert message box, a Custom Confirm message box, along with the capability to create self-made message boxes. It provides support for both Dependency Injection (DI) and non-instance-based methods, facilitating the display and concealment of message boxes.