MeltdownBoxes 1.0.2
dotnet add package MeltdownBoxes --version 1.0.2
NuGet\Install-Package MeltdownBoxes -Version 1.0.2
<PackageReference Include="MeltdownBoxes" Version="1.0.2" />
paket add MeltdownBoxes --version 1.0.2
#r "nuget: MeltdownBoxes, 1.0.2"
// Install MeltdownBoxes as a Cake Addin #addin nuget:?package=MeltdownBoxes&version=1.0.2 // Install MeltdownBoxes as a Cake Tool #tool nuget:?package=MeltdownBoxes&version=1.0.2
MeltdownBoxes
Description
MeltdownBoxes is a WPF library of alert and dialog boxes designed to enhance user interactions. With modern and user-friendly interfaces, it offers customizable alert boxes and dialogs that application developers can easily integrate into their projects.
Installation
To add this package to your project, you can follow the steps below:
Installation via NuGet
- Open Visual Studio.
- Open your project.
- From the Tools menu, select NuGet Package Manager, then click on Manage NuGet Packages for Solution....
- Go to the Browse tab and type
MeltdownBoxes
in the search box. - Select the package from the list and click the Install button.
- Accept the license agreement.
You can use the following command to install the NuGet package:
Install-Package MeltdownBoxes
Manual Installation
If you prefer not to use NuGet, you can also install the package manually:
- Download the source code from the GitHub Repository.
- Right-click on your project references and select Add Reference....
- Choose the
.dll
file from theBin
folder of the downloaded package and add it.
Dependencies
To ensure the proper functioning of this package, .NET 8 or a higher version must be present in the project.
Once the installation is complete, you can easily create alert and dialog boxes using the BoxController
class.
Usage
Before using the BoxController
class, you need to Initialize the alert and dialog boxes separately. You do not need to Initialize the structure you do not wish to use. You can use the following code examples to set up the initial configurations:
AlertBoxInitialize Method
BoxController.AlertBoxInitialize(
AlertSize.Medium,
AlertPlacement.Center,
);
The AlertBoxInitialize
method is responsible for initializing alert boxes with specific settings. Below are the parameters, their default values, and additional notes.
Parameters
Parameter Name | Type | Default Value | Required | Description |
---|---|---|---|---|
sizeType |
AlertSize |
Enum AlertSize |
Yes | The size of the alert box. |
placement |
AlertPlacement |
Enum AlertPlacement |
Yes | The placement of the alert box on the screen. |
popupAnimation |
PopupAnimation? |
PopupAnimation.Fade |
No | The animation type for the alert box popup. |
maxChild |
int? |
6 |
No | The maximum number of child elements allowed. |
duration |
double? |
5000 |
No | The duration for which the alert box is displayed. |
maxBuffer |
int? |
20 |
No | The maximum buffer size for alert messages. |
Notes
If the above values are not provided, the AlertBoxInitialize
method will work with the parameters and default values you define as mandatory.
DialogBoxInitialize Method
BoxController.DialogBoxInitialize(
DialogSize.Large,
DialogPlacement.Center,
);
The DialogBoxInitialize
method is responsible for initializing dialog boxes with specific settings. Below are the parameters, their default values, and additional notes.
Parameters
Parameter Name | Type | Default Value | Required | Description |
---|---|---|---|---|
sizeType |
DialogSize |
Enum DialogSize |
Yes | The size of the dialog box. |
dialogPlacement |
DialogPlacement |
Enum DialogPlacement |
Yes | The placement of the dialog box on the screen. |
screenPadding |
int |
10 |
No | The padding around the dialog box on the screen. |
Notes
If the above values are not provided, the DialogBoxInitialize
method will work with the parameters and default values you define as mandatory.
After these operations, both the AlertBox
and Dialog Box
structures will be ready for use. If you continue without performing these initializations, the methods will throw an error.
// Since dialog boxes are async structures, you must wait with await.
if(await BoxController.ConfirmedDialog("Do you want to proceed with this action?","Confirmation")){
MessageBox.Show("User continues.");
}
else{
MessageBox.Show("User does not continue.");
}
// AlertBoxes do not require a result, so you do not need to wait with await.
BoxController.Warning($"{DateTime.Now}", "Warning");
Examples
All AlertBoxes
and DialogBoxes
that you can call are shown below.
Alert Boxes Examples
// ALL ALERTBOXES
Random random = new Random();
int randomNumber = random.Next(1, 6);
switch (randomNumber)
{
case 1:
BoxController.Warning($"{DateTime.Now}", "Warning");
break;
case 2:
BoxController.Error($"{DateTime.Now}", "Error");
break;
case 3:
BoxController.Success($"{DateTime.Now}", "Success");
break;
case 4:
BoxController.Information($"{DateTime.Now}", "Information");
break;
default:
BoxController.Other($"{DateTime.Now}", "Other");
break;
}
This image shows all the AlertBox
structures that can be used in the package.
DialogBoxes
This image also shows the example of ConfirmedDialog
in the package.
var x = await BoxController.ConfirmedDialog("Are you sure you want to delete this item ?", "Delete Confirmation");
This image also shows the example of ContinueDialog
in the package.
var x1 = await BoxController.ContinueDialog(""Are you sure you want to continue with this operation ?", "Continue");
This image also shows the example of RetryDialog
in the package.
var x2 = await BoxController.RetryDialog("An error occurred while processing. Would you like to try again ?", "Retry Operation");
This image also shows the example of WarningDialog
in the package.
var x3 = await BoxController.WarningDialog("You have unsaved changes. Are you sure you want to exit ?", "Warning");
Contributing
MeltdownBoxes is presented as an open-source project. Therefore, anyone can contribute to the project and help enhance the features of MeltdownBoxes.
How to Contribute?
Developers who want to contribute to the project can visit the GitHub page and click the Fork
button to create a copy in their accounts. They can then clone the project copy to their computers to make changes.
After making changes, developers should commit their work and push it back to their GitHub page. Finally, they can submit a Pull Request
on the original GitHub page to integrate their changes into the original project.
How to Help?
Developers who want to help with the project can check the Issues
section on the GitHub page. This section lists the features and problems that need to be addressed for the project's development. Developers can contribute by solving these issues or developing new features.
Additionally, assistance can be provided in improving the project's documentation or adding new features. This can be done by downloading the project copy or editing the files on the GitHub page.
Contact
For any questions, suggestions, or feedback regarding the project, you can reach me at:
- Email: [email protected]
- X: @nakruf_oz
You can also share your issues or suggestions in the Issues
section on the project's GitHub page.
By reaching out to us, you can help improve the project. Your suggestions and feedback are important to us and contribute to making the project better.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows7.0 is compatible. |
-
net8.0-windows7.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.
The description errors have been corrected.