CustomControls.MAUI.MessageBox
1.0.0
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
<PackageReference Include="CustomControls.MAUI.MessageBox" Version="1.0.0" />
paket add CustomControls.MAUI.MessageBox --version 1.0.0
#r "nuget: CustomControls.MAUI.MessageBox, 1.0.0"
// 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:
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 | Versions 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. |
-
net6.0
- CommunityToolkit.Maui (>= 2.0.0)
-
net6.0-android31.0
- CommunityToolkit.Maui (>= 2.0.0)
-
net6.0-ios16.1
- CommunityToolkit.Maui (>= 2.0.0)
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
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.