WpfMessageBox 2.0.0
dotnet add package WpfMessageBox --version 2.0.0
NuGet\Install-Package WpfMessageBox -Version 2.0.0
<PackageReference Include="WpfMessageBox" Version="2.0.0" />
<PackageVersion Include="WpfMessageBox" Version="2.0.0" />
<PackageReference Include="WpfMessageBox" />
paket add WpfMessageBox --version 2.0.0
#r "nuget: WpfMessageBox, 2.0.0"
#:package WpfMessageBox@2.0.0
#addin nuget:?package=WpfMessageBox&version=2.0.0
#tool nuget:?package=WpfMessageBox&version=2.0.0
WpfMessageBox
Description
WpfMessageBox is a WPF message box implementation, aimed to be visually balanced between the default WPF style and the native .NET MessageBox. It offers the following features:
- Returns an equivalent of the standard .NET MessageBoxResults.
- Uses an equivalent of the standard MessageBox icons.
- Ability to define custom buttons text.
- Optional header text.
- Optional TextBox.
- Optional CheckBox.
Usage
Install through Nuget
WpfMessageBox uses static methods like the standard .NET MessageBox:
using WpfMessageBoxLibrary; WpfMessageBoxResult result = WpfMessageBox.Show("Some text", "Some title", WpfMessageBoxButton.OK, WpfMessageBoxImage.Exclamation);In order to use the extra features offered by WpfMessageBox, you need to initialize a new
WpfMessageBoxPropertieswhich will hold the desired properties, then use the relevant static method:using WpfMessageBoxLibrary; var msgProperties = new WpfMessageBoxProperties() { Button = WpfMessageBoxButton.OKCancel, ButtonOkText = "Set name", CheckBoxText = "Don't ask again", Image = WpfMessageBoxImage.Exclamation, Header = "No name defined", IsCheckBoxChecked = true, IsCheckBoxVisible = true, IsTextBoxVisible = true, Text = "Please enter the name to use. You can leave the field empty in order to continue using the default name.", Title = "A nice example", }; WpfMessageBoxResult result = WpfMessageBox.Show(this, ref msgProperties);The
WpfMessageBoxPropertiesobject allows you to retrieve theTextBoxandCheckBoxvalues after the user closed the message box:bool checkBoxChecked = msgProperties.IsCheckBoxChecked; string textBoxContent = msgProperties.TextBoxText;
More examples can be found in the Demo project of this repository.
Release notes
See the changelog.
License
WpfMessageBox is licensed under the MIT license - see the LICENSE file for details.
Credits
Some icons by Yusuke Kamiyamane licensed under a Creative Commons Attribution 3.0 License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0-windows7.0 is compatible. net10.0-windows was computed. net10.0-windows7.0 is compatible. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- No dependencies.
-
net10.0-windows7.0
- No dependencies.
-
net9.0-windows7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on WpfMessageBox:
| Repository | Stars |
|---|---|
|
Otiel/BandcampDownloader
A Windows app used to download albums from Bandcamp.
|
See CHANGELOG on source repository.