CustomControls.MAUI.MessageBox 1.1.0

dotnet add package CustomControls.MAUI.MessageBox --version 1.1.0
NuGet\Install-Package CustomControls.MAUI.MessageBox -Version 1.1.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.1.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.1.0
#r "nuget: CustomControls.MAUI.MessageBox, 1.1.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.1.0

// Install CustomControls.MAUI.MessageBox as a Cake Tool
#tool nuget:?package=CustomControls.MAUI.MessageBox&version=1.1.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: 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. 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. 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. 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. 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. 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: 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. 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. 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. Accessibility:

Requirement: Ensure accessibility for users with disabilities. Importance: Message boxes should be designed to accommodate users who rely on assistive technologies. 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. 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. 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:

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

Installation:

Install the NuGet package 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 net8.0-android34.0 is compatible.  net8.0-ios17.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
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 141 2/10/2024
1.0.0 228 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.